Skip to content

Commit

Permalink
Demo Feature Screen is displayed instead of Winnerscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes authored and Johannes committed Aug 3, 2012
1 parent 979c4a1 commit 64deb16
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ public LayerList<LayerInterface> LoadIngameMenuObjects()
Texture_IngameMenu_Winner_Team2, null, new Vector2(446f / 1280f, 392f / 720f), new Vector2(443f / 1280f, 180f / 720f), 92, MeasurementUnit.PercentOfScreen);
objectList.Add(WinnerScreen_Winner_Team2);
MenuObject FeatureScreen = new MenuObject("FeatureScreen", false,
Texture_IngameMenu_Winner_Team2, null, new Vector2(1280f / 1280f, 720f / 720f), Vector2.Zero, 92, MeasurementUnit.PercentOfScreen);
Texture_IngameMenu_FeatureScreen, null, new Vector2(1280f / 1280f, 720f / 720f), Vector2.Zero, 92, MeasurementUnit.PercentOfScreen);
objectList.Add(FeatureScreen);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ protected override void Initialize()
Logger.Instance.log(Sender.Game1, "Initialize() done successfully",PriorityLevel.Priority_2);
base.Initialize();

Guide.SimulateTrialMode = true;
Guide.SimulateTrialMode = false;
//play IntroVideo on game start
if(((bool)SettingsManager.Instance.get("IntroVideo")) && Guide.IsTrialMode)
playVideo(video);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,16 @@ public void activateMenu(int winner)

menuState = 1;

// When in DemoMode show FeatureScreen
if ((bool)SettingsManager.Instance.get("IsTrialMode"))
menuState = 3;

// Make all necessary menu objects visible
for (int i = 0; i < menuStructure.GetLength(1); i++)
{
if (menuStructure[1, i] != null)
{
foreach (LayerInterface menuObject in menuStructure[1, i])
foreach (LayerInterface menuObject in menuStructure[menuState, i])
{
((DrawableObject)menuObject).Visible = true;
}
Expand All @@ -170,18 +174,23 @@ public void activateMenu(int winner)

menuState = 2;

// When in DemoMode show FeatureScreen
if ((bool)SettingsManager.Instance.get("IsTrialMode"))
menuState = 3;

// Make all necessary menu objects visible
for (int i = 0; i < menuStructure.GetLength(1); i++)
{
if (menuStructure[2, i] != null)
{
foreach (LayerInterface menuObject in menuStructure[2, i])
foreach (LayerInterface menuObject in menuStructure[menuState, i])
{
((DrawableObject)menuObject).Visible = true;
}
}
}


}

animateTransition(menuState);
Expand Down Expand Up @@ -349,7 +358,7 @@ private void createMenuStructure()
// 1.Index: Menu state
// 2.Index: 0: List of Menu_PassiveObjects which are always shown/never highlighted (e.g. background)
// all other indexes: List of Menu_Buttons which belong to a single selectable item
menuStructure = new List<LayerInterface>[3, 4];
menuStructure = new List<LayerInterface>[4, 4];

// Normal ingame menu
menuStructure[0, 0] = new List<LayerInterface>();
Expand Down Expand Up @@ -380,6 +389,14 @@ private void createMenuStructure()
menuStructure[2, 2] = new List<LayerInterface>();
menuStructure[2, 3] = new List<LayerInterface>();

// Demo Feature Screen
menuStructure[3, 0] = new List<LayerInterface>();
menuStructure[3, 0].Add(menuObjectList.GetObjectByName("FeatureScreen"));
menuStructure[3, 1] = new List<LayerInterface>();
menuStructure[3, 0].Add(menuObjectList.GetObjectByName("FeatureScreen"));
menuStructure[3, 2] = new List<LayerInterface>();
menuStructure[3, 3] = new List<LayerInterface>();

}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Video IntroVideo
/// 4: really quit
/// 5: select level
/// 6: intro
/// 7: help first start (is just shown when the game starts for the first time
/// 7: help first start (is just shown when the game starts for the first time)
/// </summary>
private int menuState;

Expand Down Expand Up @@ -1950,7 +1950,7 @@ private void startGame()
possibleIndexes.Remove(index);
}
}

winCondition = new TimeLimit_WinCondition(new TimeSpan(0, 0, 5));
// Start game
SuperController.Instance.switchFromMainMenuToIngame(levelName, winCondition, leftPlayers, rightPlayers);

Expand Down

0 comments on commit 64deb16

Please sign in to comment.