(a7d754a40) Fixed: ContextualTutorial not resetting properly when quitting a single player campaign session and starting a new game after. Added: Forced on for contextual tutorial when the selected sub is 'PAX'

This commit is contained in:
Joonas Rikkonen
2019-03-27 20:52:16 +02:00
parent 018fcb0fa0
commit b66bdb6da4
10 changed files with 256 additions and 17 deletions
@@ -44,7 +44,7 @@ namespace Barotrauma
ContextualTutorial = Tutorial.Tutorials.Find(t => t is ContextualTutorial) as ContextualTutorial;
if (ContextualTutorial.Selected && !ContextualTutorial.Initialized) // Selected when starting a new game -> initialize
if (ContextualTutorial.Selected) // Selected when starting a new game -> initialize
{
ContextualTutorial.Initialize();
}
@@ -100,6 +100,11 @@ namespace Barotrauma.Tutorials
public override void Initialize()
{
for (int i = 0; i < segments.Count; i++)
{
segments[i].IsTriggered = false;
}
if (Initialized) return;
Initialized = true;
@@ -111,11 +116,6 @@ namespace Barotrauma.Tutorials
public void LoadPartiallyComplete(XElement element)
{
for (int i = 0; i < segments.Count; i++)
{
segments[i].IsTriggered = false;
}
int[] completedSegments = element.GetAttributeIntArray("completedsegments", null);
if (completedSegments == null || completedSegments.Length == 0)