(e8befa230) Added: Unlocking of tutorials one by one. Fixed: EngineerTutorial's submarine reactor not starting properly in the off-state

This commit is contained in:
Joonas Rikkonen
2019-05-23 15:09:42 +03:00
parent a359450b0d
commit cd5d81c3f1
4 changed files with 36 additions and 4 deletions
@@ -521,7 +521,20 @@ namespace Barotrauma
GUIButton otherButton = child as GUIButton;
if (otherButton == null || otherButton == button) continue;
otherButton.Selected = false;
return true;
}
public bool ReturnToMainMenu(GUIButton button, object obj)
{
GUI.PreventPauseMenuToggle = false;
if (Selected != this)
{
Select();
}
else
{
ResetButtonStates(button);
}
}
#endregion
@@ -584,11 +597,28 @@ namespace Barotrauma
private void UpdateTutorialList()
{
var tutorialList = menuTabs[(int)Tab.Tutorials].GetChild<GUIListBox>();
int completedTutorials = 0;
foreach (GUITextBlock tutorialText in tutorialList.Content.Children)
{
if (((Tutorial)tutorialText.UserData).Completed)
{
tutorialText.TextColor = Color.LightGreen;
completedTutorials++;
}
}
for (int i = 0; i < tutorialList.Content.Children.Count(); i++)
{
if (i < completedTutorials + 1)
{
(tutorialList.Content.GetChild(i) as GUITextBlock).TextColor = Color.LightGreen;
(tutorialList.Content.GetChild(i) as GUITextBlock).CanBeFocused = true;
}
else
{
(tutorialList.Content.GetChild(i) as GUITextBlock).TextColor = Color.Gray;
(tutorialList.Content.GetChild(i) as GUITextBlock).CanBeFocused = false;
}
}
}