(c1468d39d) Overhauled docking interface (WIP)
This commit is contained in:
@@ -9,6 +9,8 @@ namespace Barotrauma
|
||||
{
|
||||
class SinglePlayerCampaign : CampaignMode
|
||||
{
|
||||
public ContextualTutorial ContextualTutorial;
|
||||
|
||||
private GUIButton endRoundButton;
|
||||
|
||||
private bool crewDead;
|
||||
@@ -39,6 +41,13 @@ namespace Barotrauma
|
||||
CrewManager.AddCharacterInfo(new CharacterInfo(Character.HumanConfigFile, "", jobPrefab));
|
||||
}
|
||||
}
|
||||
|
||||
ContextualTutorial = Tutorial.Tutorials.Find(t => t is ContextualTutorial) as ContextualTutorial;
|
||||
|
||||
if (ContextualTutorial.Selected) // Selected when starting a new game -> initialize
|
||||
{
|
||||
ContextualTutorial.Initialize();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
@@ -56,6 +65,11 @@ namespace Barotrauma
|
||||
endTimer = 5.0f;
|
||||
isRunning = true;
|
||||
CrewManager.InitSinglePlayerRound();
|
||||
|
||||
if (ContextualTutorial.Initialized)
|
||||
{
|
||||
ContextualTutorial.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public bool TryHireCharacter(Location location, CharacterInfo characterInfo)
|
||||
@@ -148,6 +162,11 @@ namespace Barotrauma
|
||||
base.AddToGUIUpdateList();
|
||||
CrewManager.AddToGUIUpdateList();
|
||||
endRoundButton.AddToGUIUpdateList();
|
||||
|
||||
if (ContextualTutorial.Initialized)
|
||||
{
|
||||
ContextualTutorial.AddToGUIUpdateList();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime)
|
||||
@@ -156,6 +175,11 @@ namespace Barotrauma
|
||||
|
||||
base.Update(deltaTime);
|
||||
|
||||
if (ContextualTutorial.Initialized)
|
||||
{
|
||||
ContextualTutorial.Update(deltaTime);
|
||||
}
|
||||
|
||||
if (!GUI.DisableHUD && !GUI.DisableUpperHUD)
|
||||
{
|
||||
endRoundButton.UpdateManually(deltaTime);
|
||||
@@ -292,6 +316,7 @@ namespace Barotrauma
|
||||
TextManager.Get("QuitButton"));
|
||||
quitButton.OnClicked += GameMain.LobbyScreen.QuitToMainMenu;
|
||||
quitButton.OnClicked += (GUIButton button, object obj) => { GUIMessageBox.MessageBoxes.Remove(GUIMessageBox.VisibleBox); return true; };
|
||||
quitButton.OnClicked += (GUIButton button, object obj) => { if (ContextualTutorial.Initialized) ContextualTutorial.Stop(); return true; };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,6 +401,10 @@ namespace Barotrauma
|
||||
case "map":
|
||||
campaign.map = Map.LoadNew(subElement);
|
||||
break;
|
||||
case "contextualtutorial":
|
||||
campaign.ContextualTutorial.Initialize(); // Initialize when saved element found
|
||||
campaign.ContextualTutorial.LoadPartiallyComplete(subElement);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,6 +440,12 @@ namespace Barotrauma
|
||||
new XAttribute("cheatsenabled", CheatsEnabled));
|
||||
CrewManager.Save(modeElement);
|
||||
Map.Save(modeElement);
|
||||
|
||||
if (ContextualTutorial.Initialized)
|
||||
{
|
||||
ContextualTutorial.SavePartiallyComplete(modeElement);
|
||||
}
|
||||
|
||||
element.Add(modeElement);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user