(6f4bea467) Updated doors
This commit is contained in:
+33
-6
@@ -148,7 +148,7 @@ namespace Barotrauma.Tutorials
|
||||
TriggerTutorialSegment(0);
|
||||
do
|
||||
{
|
||||
yield return new WaitForSeconds(1.5f);
|
||||
yield return null;
|
||||
GameMain.GameSession.CrewManager.HighlightOrderButton(captain_medic, "follow", highlightColor, new Vector2(5, 5));
|
||||
}
|
||||
while (!HasOrder(captain_medic, "follow"));
|
||||
@@ -163,28 +163,31 @@ namespace Barotrauma.Tutorials
|
||||
GameMain.GameSession.CrewManager.AddCharacter(captain_mechanic);
|
||||
do
|
||||
{
|
||||
yield return new WaitForSeconds(1.5f);
|
||||
yield return null;
|
||||
GameMain.GameSession.CrewManager.HighlightOrderButton(captain_mechanic, "repairsystems", highlightColor, new Vector2(5, 5));
|
||||
HighlightOrderOption("jobspecific");
|
||||
}
|
||||
while (!HasOrder(captain_mechanic, "repairsystems"));
|
||||
while (!HasOrder(captain_mechanic, "repairsystems", "jobspecific"));
|
||||
RemoveCompletedObjective(segments[1]);
|
||||
yield return new WaitForSeconds(2f);
|
||||
TriggerTutorialSegment(2);
|
||||
GameMain.GameSession.CrewManager.AddCharacter(captain_security);
|
||||
do
|
||||
{
|
||||
yield return new WaitForSeconds(1.5f);
|
||||
yield return null;
|
||||
GameMain.GameSession.CrewManager.HighlightOrderButton(captain_security, "operateweapons", highlightColor, new Vector2(5, 5));
|
||||
HighlightOrderOption("fireatwill");
|
||||
}
|
||||
while (!HasOrder(captain_security, "operateweapons"));
|
||||
while (!HasOrder(captain_security, "operateweapons", "fireatwill"));
|
||||
RemoveCompletedObjective(segments[2]);
|
||||
yield return new WaitForSeconds(4f);
|
||||
TriggerTutorialSegment(3);
|
||||
GameMain.GameSession.CrewManager.AddCharacter(captain_engineer);
|
||||
do
|
||||
{
|
||||
yield return new WaitForSeconds(1.5f);
|
||||
yield return null;
|
||||
GameMain.GameSession.CrewManager.HighlightOrderButton(captain_engineer, "operatereactor", highlightColor, new Vector2(5, 5));
|
||||
HighlightOrderOption("powerup");
|
||||
}
|
||||
while (!HasOrder(captain_engineer, "operatereactor", "powerup"));
|
||||
RemoveCompletedObjective(segments[3]);
|
||||
@@ -236,6 +239,30 @@ namespace Barotrauma.Tutorials
|
||||
CoroutineManager.StartCoroutine(TutorialCompleted());
|
||||
}
|
||||
|
||||
private void HighlightOrderOption(string option)
|
||||
{
|
||||
if (GameMain.GameSession.CrewManager.OrderOptionButtons.Count == 0) return;
|
||||
var order = GameMain.GameSession.CrewManager.OrderOptionButtons[0].UserData as Order;
|
||||
|
||||
int orderIndex = 0;
|
||||
for (int i = 0; i < GameMain.GameSession.CrewManager.OrderOptionButtons.Count; i++)
|
||||
{
|
||||
if (orderIndex >= order.Options.Length)
|
||||
{
|
||||
orderIndex = 0;
|
||||
}
|
||||
if (order.Options[orderIndex] == option)
|
||||
{
|
||||
if (GameMain.GameSession.CrewManager.OrderOptionButtons[i].Frame.FlashTimer <= 0)
|
||||
{
|
||||
GameMain.GameSession.CrewManager.OrderOptionButtons[i].Frame.Flash(highlightColor);
|
||||
}
|
||||
}
|
||||
|
||||
orderIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsSelectedItem(Item item)
|
||||
{
|
||||
return captain?.SelectedConstruction == item;
|
||||
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
/*using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -9,6 +9,11 @@ namespace Barotrauma.Tutorials
|
||||
{
|
||||
class ContextualTutorial : Tutorial
|
||||
{
|
||||
public ContextualTutorial(XElement element) : base(element)
|
||||
{
|
||||
//Name = "ContextualTutorial";
|
||||
}
|
||||
|
||||
public static bool Selected = false;
|
||||
|
||||
private Steering navConsole;
|
||||
@@ -32,11 +37,6 @@ namespace Barotrauma.Tutorials
|
||||
private float medicalTutorialTimer = 0.0f;
|
||||
private const float medicalTutorialDelay = 2.0f;
|
||||
|
||||
public ContextualTutorial(XElement element) : base(element)
|
||||
{
|
||||
Name = "ContextualTutorial";
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -517,4 +517,4 @@ namespace Barotrauma.Tutorials
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
+1
-1
@@ -170,7 +170,7 @@ namespace Barotrauma.Tutorials
|
||||
yield return new WaitForSeconds(2.0f);
|
||||
}*/
|
||||
|
||||
TriggerTutorialSegment(0, GameMain.Config.KeyBind(InputType.Use), GameMain.Config.KeyBind(InputType.Deselect)); // Medical supplies objective
|
||||
TriggerTutorialSegment(0, GameMain.Config.KeyBind(InputType.Select), GameMain.Config.KeyBind(InputType.Deselect)); // Medical supplies objective
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
+14
-1
@@ -272,7 +272,7 @@ namespace Barotrauma.Tutorials
|
||||
}
|
||||
|
||||
yield return null;
|
||||
} while (engineer.Inventory.FindItemByIdentifier("screwdriver") == null || engineer.Inventory.FindItemByIdentifier("redwire") == null || engineer.Inventory.FindItemByIdentifier("bluewire") == null); // Wait until looted
|
||||
} while (!engineer_equipmentCabinet.Inventory.IsEmpty()); // Wait until looted
|
||||
RemoveCompletedObjective(segments[0]);
|
||||
SetHighlight(engineer_equipmentCabinet.Item, false);
|
||||
SetHighlight(engineer_reactor.Item, true);
|
||||
@@ -286,6 +286,7 @@ namespace Barotrauma.Tutorials
|
||||
{
|
||||
if (IsSelectedItem(engineer_reactor.Item))
|
||||
{
|
||||
engineer_reactor.AutoTempSlider.BarScrollValue = 1.0f;
|
||||
if (engineer_reactor.OnOffSwitch.FlashTimer <= 0)
|
||||
{
|
||||
engineer_reactor.OnOffSwitch.Flash(highlightColor, 1.5f, false);
|
||||
@@ -297,6 +298,7 @@ namespace Barotrauma.Tutorials
|
||||
{
|
||||
if (IsSelectedItem(engineer_reactor.Item) && engineer_reactor.Item.OwnInventory.slots != null)
|
||||
{
|
||||
engineer_reactor.AutoTempSlider.BarScrollValue = 1.0f;
|
||||
HighlightInventorySlot(engineer.Inventory, "fuelrod", highlightColor, 0.5f, 0.5f, 0f);
|
||||
|
||||
for (int i = 0; i < engineer_reactor.Item.OwnInventory.slots.Length; i++)
|
||||
@@ -311,6 +313,7 @@ namespace Barotrauma.Tutorials
|
||||
{
|
||||
if (IsSelectedItem(engineer_reactor.Item))
|
||||
{
|
||||
engineer_reactor.AutoTempSlider.BarScrollValue = 1.0f;
|
||||
if (engineer_reactor.FissionRateScrollBar.FlashTimer <= 0)
|
||||
{
|
||||
engineer_reactor.FissionRateScrollBar.Flash(highlightColor, 1.5f);
|
||||
@@ -336,6 +339,16 @@ namespace Barotrauma.Tutorials
|
||||
}
|
||||
yield return null;
|
||||
} while (!engineer_reactor.AutoTemp);
|
||||
|
||||
float wait = 1.5f;
|
||||
do
|
||||
{
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
wait -= 0.1f;
|
||||
engineer_reactor.AutoTempSlider.BarScrollValue = 0.0f;
|
||||
} while (wait > 0.0f);
|
||||
engineer.SelectedConstruction = null;
|
||||
engineer_reactor.CanBeSelected = false;
|
||||
RemoveCompletedObjective(segments[1]);
|
||||
SetHighlight(engineer_reactor.Item, false);
|
||||
SetHighlight(engineer_brokenJunctionBox, true);
|
||||
|
||||
+9
-6
@@ -317,11 +317,14 @@ namespace Barotrauma.Tutorials
|
||||
SetHighlight(mechanic_workingPump.Item, true);
|
||||
do
|
||||
{
|
||||
if (mechanic_workingPump.IsActiveSlider.FlashTimer <= 0)
|
||||
{
|
||||
mechanic_workingPump.IsActiveSlider.Flash(uiHighlightColor, 1.5f, true);
|
||||
}
|
||||
yield return null;
|
||||
if (IsSelectedItem(mechanic_brokenPump.Item))
|
||||
{
|
||||
if (mechanic_workingPump.IsActiveSlider.FlashTimer <= 0)
|
||||
{
|
||||
mechanic_workingPump.IsActiveSlider.Flash(uiHighlightColor, 1.5f, true);
|
||||
}
|
||||
}
|
||||
} while (mechanic_workingPump.FlowPercentage >= 0 || !mechanic_workingPump.IsActive); // Highlight until draining
|
||||
SetHighlight(mechanic_workingPump.Item, false);
|
||||
do { yield return null; } while (mechanic_brokenhull_1.WaterPercentage > waterVolumeBeforeOpening); // Unlock door once drained
|
||||
@@ -505,11 +508,12 @@ namespace Barotrauma.Tutorials
|
||||
mechanic.AddActiveObjectiveEntity(mechanic_brokenWall_2, mechanic_repairIcon, mechanic_repairIconColor);
|
||||
do { yield return null; } while (WallHasDamagedSections(mechanic_brokenWall_2));
|
||||
mechanic.RemoveActiveObjectiveEntity(mechanic_brokenWall_2);
|
||||
TriggerTutorialSegment(9, GameMain.Config.KeyBind(InputType.Select)); // Repairing machinery (pump)
|
||||
TriggerTutorialSegment(9, GameMain.Config.KeyBind(InputType.Use)); // Repairing machinery (pump)
|
||||
SetHighlight(mechanic_brokenPump.Item, true);
|
||||
Repairable repairablePumpComponent = mechanic_brokenPump.Item.GetComponent<Repairable>();
|
||||
do
|
||||
{
|
||||
yield return null;
|
||||
if (!mechanic_brokenPump.Item.IsFullCondition)
|
||||
{
|
||||
if (!mechanic.HasEquippedItem("wrench"))
|
||||
@@ -524,7 +528,6 @@ namespace Barotrauma.Tutorials
|
||||
}
|
||||
}
|
||||
}
|
||||
yield return null;
|
||||
} while (!mechanic_brokenPump.Item.IsFullCondition || mechanic_brokenPump.FlowPercentage >= 0 || !mechanic_brokenPump.IsActive);
|
||||
RemoveCompletedObjective(segments[9]);
|
||||
SetHighlight(mechanic_brokenPump.Item, false);
|
||||
|
||||
@@ -22,9 +22,6 @@ namespace Barotrauma.Tutorials
|
||||
private Action infoBoxClosedCallback;
|
||||
protected XElement configElement;
|
||||
|
||||
private enum TutorialType { None, Scenario, Contextual };
|
||||
private TutorialType tutorialType = TutorialType.None;
|
||||
|
||||
protected VideoPlayer videoPlayer;
|
||||
protected enum TutorialContentTypes { None = 0, Video = 1, ManualVideo = 2, TextOnly = 3 };
|
||||
protected string playableContentPath;
|
||||
@@ -164,7 +161,6 @@ namespace Barotrauma.Tutorials
|
||||
configElement = element;
|
||||
Name = element.GetAttributeString("name", "Unnamed");
|
||||
completed = GameMain.Config.CompletedTutorialNames.Contains(Name);
|
||||
Enum.TryParse(element.GetAttributeString("tutorialtype", "Scenario"), true, out tutorialType);
|
||||
playableContentPath = element.GetAttributeString("playablecontentpath", "");
|
||||
|
||||
segments = new List<TutorialSegment>();
|
||||
@@ -386,14 +382,12 @@ namespace Barotrauma.Tutorials
|
||||
};
|
||||
|
||||
string objectiveText = TextManager.ParseInputTypes(objectiveTranslated);
|
||||
int yOffset = (int)((GUI.ObjectiveNameFont.MeasureString(objectiveText).Y / 2f + 5) * GUI.Scale);
|
||||
int yOffset = (int)((GUI.ObjectiveNameFont.MeasureString(objectiveText).Y / 2f + 5));
|
||||
segment.LinkedTitle = new GUITextBlock(new RectTransform(new Point((int)GUI.ObjectiveNameFont.MeasureString(objectiveText).X, yOffset), segment.ReplayButton.RectTransform, Anchor.CenterRight, Pivot.BottomRight) { AbsoluteOffset = new Point((int)(-10 * GUI.Scale), 0) },
|
||||
objectiveText, textColor: Color.White, font: GUI.ObjectiveTitleFont, textAlignment: Alignment.CenterRight);
|
||||
segment.LinkedText = new GUITextBlock(new RectTransform(new Point(replayButtonSize.X, yOffset), segment.ReplayButton.RectTransform, Anchor.Center, Pivot.TopCenter) { AbsoluteOffset = new Point((int)(10 * GUI.Scale), 0) },
|
||||
TextManager.ParseInputTypes(segment.Objective), textColor: new Color(4, 180, 108), font: GUI.ObjectiveNameFont, textAlignment: Alignment.CenterRight);
|
||||
|
||||
segment.LinkedTitle.TextScale = segment.LinkedText.TextScale = GUI.Scale;
|
||||
|
||||
|
||||
segment.LinkedTitle.Color = segment.LinkedTitle.HoverColor = segment.LinkedTitle.PressedColor = segment.LinkedTitle.SelectedColor = Color.Transparent;
|
||||
segment.LinkedText.Color = segment.LinkedText.HoverColor = segment.LinkedText.PressedColor = segment.LinkedText.SelectedColor = Color.Transparent;
|
||||
segment.ReplayButton.Color = segment.ReplayButton.HoverColor = segment.ReplayButton.PressedColor = segment.ReplayButton.SelectedColor = Color.Transparent;
|
||||
@@ -488,11 +482,10 @@ namespace Barotrauma.Tutorials
|
||||
protected GUIComponent CreateInfoFrame(string title, string text, int width = 300, int height = 80, string anchorStr = "", bool hasButton = false, Action callback = null, Action showVideo = null)
|
||||
{
|
||||
if (hasButton) height += 60;
|
||||
|
||||
string wrappedText = ToolBox.WrapText(text, width, GUI.Font);
|
||||
|
||||
float textScale = GUI.Scale;
|
||||
string wrappedText = ToolBox.WrapText(text, width, GUI.Font, textScale);
|
||||
|
||||
height += (int)(GUI.Font.MeasureString(wrappedText).Y * textScale + 50);
|
||||
height += (int)(GUI.Font.MeasureString(wrappedText).Y + 50);
|
||||
if (title.Length > 0)
|
||||
{
|
||||
height += 35;
|
||||
@@ -505,35 +498,37 @@ namespace Barotrauma.Tutorials
|
||||
Enum.TryParse(anchorStr, out anchor);
|
||||
}
|
||||
|
||||
var infoBlock = new GUIFrame(new RectTransform(new Point((int)(width * GUI.Scale), (int)(height * GUI.Scale)), GUI.Canvas, anchor) { AbsoluteOffset = new Point(20) });
|
||||
var background = new GUIFrame(new RectTransform(new Point(GameMain.GraphicsWidth, GameMain.GraphicsHeight), GUI.Canvas, Anchor.Center), "InnerFrame", new Color(0, 0, 0, 1f));
|
||||
|
||||
var infoBlock = new GUIFrame(new RectTransform(new Point((int)(width * GUI.Scale), (int)(height * GUI.Scale)), background.RectTransform, anchor) { AbsoluteOffset = new Point(20) });
|
||||
infoBlock.Flash(Color.Green);
|
||||
|
||||
var infoContent = new GUILayoutGroup(new RectTransform(new Vector2(0.9f, 0.8f), infoBlock.RectTransform, Anchor.Center))
|
||||
{
|
||||
Stretch = true,
|
||||
RelativeSpacing = 0.05f
|
||||
AbsoluteSpacing = 5
|
||||
};
|
||||
|
||||
if (title.Length > 0)
|
||||
{
|
||||
var titleBlock = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), infoContent.RectTransform),
|
||||
title, font: GUI.VideoTitleFont, textAlignment: Alignment.Center, textColor: new Color(253, 174, 0));
|
||||
titleBlock.TextScale = textScale;
|
||||
titleBlock.RectTransform.IsFixedSize = true;
|
||||
}
|
||||
|
||||
var textBlock = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), infoContent.RectTransform),
|
||||
text, wrap: true);
|
||||
textBlock.TextScale = textScale;
|
||||
var textBlock = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), infoContent.RectTransform), text, wrap: true);
|
||||
textBlock.RectTransform.IsFixedSize = true;
|
||||
|
||||
infoBoxClosedCallback = callback;
|
||||
|
||||
if (hasButton)
|
||||
{
|
||||
var buttonContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.2f), infoContent.RectTransform) { MinSize = new Point(0, 30) }, isHorizontal: true)
|
||||
var buttonContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.3f), infoContent.RectTransform) { MinSize = new Point(0, 30), MaxSize = new Point((int) infoContent.Rect.X, 60) }, isHorizontal: true)
|
||||
{
|
||||
Stretch = true,
|
||||
RelativeSpacing = 0.1f
|
||||
};
|
||||
buttonContainer.RectTransform.IsFixedSize = true;
|
||||
|
||||
if (showVideo != null)
|
||||
{
|
||||
@@ -555,9 +550,11 @@ namespace Barotrauma.Tutorials
|
||||
};
|
||||
}
|
||||
|
||||
infoBlock.RectTransform.NonScaledSize = new Point(infoBlock.Rect.Width, (int)(infoContent.Children.Sum(c => c.Rect.Height + infoContent.AbsoluteSpacing) / infoContent.RectTransform.RelativeSize.Y));
|
||||
|
||||
GUI.PlayUISound(GUISoundType.UIMessage);
|
||||
|
||||
return infoBlock;
|
||||
return background;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user