(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

View File

@@ -165,9 +165,9 @@ namespace Barotrauma.Tutorials
{
yield return null;
GameMain.GameSession.CrewManager.HighlightOrderButton(captain_mechanic, "repairsystems", highlightColor, new Vector2(5, 5));
//HighlightOrderOption("jobspecific");
HighlightOrderOption("jobspecific");
}
while (!HasOrder(captain_mechanic, "repairsystems"));
while (!HasOrder(captain_mechanic, "repairsystems", "jobspecific"));
RemoveCompletedObjective(segments[1]);
yield return new WaitForSeconds(2f, false);
TriggerTutorialSegment(2);

View File

@@ -193,6 +193,7 @@ namespace Barotrauma.Tutorials
engineer_submarineJunctionBox_2 = Item.ItemList.Find(i => i.HasTag("engineer_submarinejunctionbox_2"));
engineer_submarineJunctionBox_3 = Item.ItemList.Find(i => i.HasTag("engineer_submarinejunctionbox_3"));
engineer_submarineReactor = Item.ItemList.Find(i => i.HasTag("engineer_submarinereactor")).GetComponent<Reactor>();
engineer_submarineReactor.OnOffSwitch.BarScrollValue = .25f;
engineer_submarineReactor.IsActive = engineer_submarineReactor.AutoTemp = false;
engineer_submarineJunctionBox_1.Indestructible = false;

View File

@@ -330,6 +330,7 @@ namespace Barotrauma.Tutorials
do { yield return null; } while (mechanic_brokenhull_1.WaterPercentage > waterVolumeBeforeOpening); // Unlock door once drained
RemoveCompletedObjective(segments[3]);
SetDoorAccess(mechanic_thirdDoor, mechanic_thirdDoorLight, true);
yield return new WaitForSeconds(1.5f, false);
//TriggerTutorialSegment(11, GameMain.Config.KeyBind(InputType.Select), GameMain.Config.KeyBind(InputType.Up), GameMain.Config.KeyBind(InputType.Down), GameMain.Config.KeyBind(InputType.Select)); // Ladder objective
//do { yield return null; } while (!mechanic_ladderSensor.MotionDetected);
//RemoveCompletedObjective(segments[11]);

View File

@@ -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;
}
}
}