(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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user