Unstable 0.15.15.0 (and the one before it I forgor)
This commit is contained in:
@@ -40,12 +40,13 @@ namespace Barotrauma
|
||||
|
||||
private List<SoldEntity> SoldEntities { get; } = new List<SoldEntity>();
|
||||
|
||||
// The bag slot is intentionally left out since we want to be able to sell items from there
|
||||
private readonly List<InvSlotType> equipmentSlots = new List<InvSlotType>() { InvSlotType.Head, InvSlotType.InnerClothes, InvSlotType.OuterClothes, InvSlotType.Headset, InvSlotType.Card };
|
||||
|
||||
public IEnumerable<Item> GetSellableItems(Character character)
|
||||
{
|
||||
if (character == null) { return new List<Item>(); }
|
||||
var confirmedSoldEntities = GetConfirmedSoldEntities();
|
||||
// The bag slot is intentionally left out since we want to be able to sell items from there
|
||||
var equipmentSlots = new List<InvSlotType>() { InvSlotType.Head, InvSlotType.InnerClothes, InvSlotType.OuterClothes, InvSlotType.Headset, InvSlotType.Card };
|
||||
return character.Inventory.FindAllItems(item =>
|
||||
{
|
||||
if (!IsItemSellable(item, confirmedSoldEntities)) { return false; }
|
||||
@@ -73,6 +74,7 @@ namespace Barotrauma
|
||||
return Submarine.MainSub.GetItems(true).FindAll(item =>
|
||||
{
|
||||
if (!IsItemSellable(item, confirmedSoldEntities)) { return false; }
|
||||
if (item.GetRootInventoryOwner() is Character) { return false; }
|
||||
if (!item.Components.All(c => !(c is Holdable h) || !h.Attachable || !h.Attached)) { return false; }
|
||||
if (!item.Components.All(c => !(c is Wire w) || w.Connections.All(c => c == null))) { return false; }
|
||||
if (!ItemAndAllContainersInteractable(item)) { return false; }
|
||||
@@ -101,7 +103,7 @@ namespace Barotrauma
|
||||
private bool IsItemSellable(Item item, IEnumerable<SoldEntity> confirmedSoldEntities)
|
||||
{
|
||||
if (!item.Prefab.CanBeSold) { return false; }
|
||||
if (item.SpawnedInOutpost) { return false; }
|
||||
if (item.SpawnedInCurrentOutpost) { return false; }
|
||||
if (!item.Prefab.AllowSellingWhenBroken && item.ConditionPercentage < 90.0f) { return false; }
|
||||
if (confirmedSoldEntities.Any(it => it.Item == item)) { return false; }
|
||||
if (item.OwnInventory?.Container is ItemContainer itemContainer)
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Barotrauma
|
||||
{
|
||||
AutoHideScrollBar = false,
|
||||
CanBeFocused = false,
|
||||
CanDragElements = true,
|
||||
CurrentDragMode = GUIListBox.DragMode.DragWithinBox,
|
||||
CanInteractWhenUnfocusable = true,
|
||||
OnSelected = (component, userData) => false,
|
||||
SelectMultiple = false,
|
||||
@@ -359,34 +359,41 @@ namespace Barotrauma
|
||||
CanBeFocused = false
|
||||
};
|
||||
|
||||
var jobIconBackground = new GUIImage(
|
||||
// Hide the icon to make more space for the name if the crew list's width is small enough
|
||||
bool isJobIconVisible = crewListEntrySize.X >= 220;
|
||||
|
||||
if (isJobIconVisible)
|
||||
{
|
||||
var jobIconBackground = new GUIImage(
|
||||
new RectTransform(new Vector2(0.8f * iconRelativeWidth, 0.8f), layoutGroup.RectTransform),
|
||||
jobIndicatorBackground,
|
||||
scaleToFit: true)
|
||||
{
|
||||
CanBeFocused = false,
|
||||
UserData = "job"
|
||||
};
|
||||
if (character?.Info?.Job.Prefab?.Icon != null)
|
||||
{
|
||||
new GUIImage(
|
||||
new RectTransform(Vector2.One, jobIconBackground.RectTransform),
|
||||
character.Info.Job.Prefab.Icon,
|
||||
scaleToFit: true)
|
||||
{
|
||||
CanBeFocused = false,
|
||||
Color = character.Info.Job.Prefab.UIColor,
|
||||
HoverColor = character.Info.Job.Prefab.UIColor,
|
||||
PressedColor = character.Info.Job.Prefab.UIColor,
|
||||
SelectedColor = character.Info.Job.Prefab.UIColor
|
||||
UserData = "job"
|
||||
};
|
||||
if (character?.Info?.Job.Prefab?.Icon != null)
|
||||
{
|
||||
new GUIImage(
|
||||
new RectTransform(Vector2.One, jobIconBackground.RectTransform),
|
||||
character.Info.Job.Prefab.Icon,
|
||||
scaleToFit: true)
|
||||
{
|
||||
CanBeFocused = false,
|
||||
Color = character.Info.Job.Prefab.UIColor,
|
||||
HoverColor = character.Info.Job.Prefab.UIColor,
|
||||
PressedColor = character.Info.Job.Prefab.UIColor,
|
||||
SelectedColor = character.Info.Job.Prefab.UIColor
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
int iconsVisible = isJobIconVisible ? 5 : 4;
|
||||
var nameRelativeWidth = 1.0f
|
||||
// Start padding
|
||||
- paddingRelativeWidth
|
||||
// 5 icons (job, 3 orders, sound)
|
||||
- (5 * 0.8f * iconRelativeWidth)
|
||||
// icons (job, active orders, current task / voip)
|
||||
- (iconsVisible * 0.8f * iconRelativeWidth)
|
||||
// Vertical line
|
||||
- (0.1f * iconRelativeWidth)
|
||||
// Spacing
|
||||
@@ -425,7 +432,7 @@ namespace Barotrauma
|
||||
var currentOrderList = new GUIListBox(new RectTransform(new Vector2(0.0f, 1.0f), parent: orderGroup.RectTransform), isHorizontal: true, style: null)
|
||||
{
|
||||
AllowMouseWheelScroll = false,
|
||||
CanDragElements = true,
|
||||
CurrentDragMode = GUIListBox.DragMode.DragWithinBox,
|
||||
HideChildrenOutsideFrame = false,
|
||||
KeepSpaceForScrollBar = false,
|
||||
OnRearranged = OnOrdersRearranged,
|
||||
@@ -439,7 +446,9 @@ namespace Barotrauma
|
||||
if (component is GUIListBox list)
|
||||
{
|
||||
list.CanBeFocused = CanIssueOrders;
|
||||
list.CanDragElements = CanIssueOrders && list.Content.CountChildren > 1;
|
||||
list.CurrentDragMode = CanIssueOrders && list.Content.CountChildren > 1
|
||||
? GUIListBox.DragMode.DragWithinBox
|
||||
: GUIListBox.DragMode.NoDragging;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -507,8 +516,11 @@ namespace Barotrauma
|
||||
{
|
||||
if (!(characterComponent?.UserData is Character character)) { return; }
|
||||
if (character.Info?.Job?.Prefab == null) { return; }
|
||||
string tooltip = TextManager.GetWithVariables("crewlistelementtooltip",
|
||||
new string[] { "[name]", "[job]" },
|
||||
new string[] { character.Name, character.Info.Job.Name });
|
||||
string color = XMLExtensions.ColorToString(character.Info.Job.Prefab.UIColor);
|
||||
string tooltip = $"‖color:{color}‖{character.Name} ({character.Info.Job.Name})‖color:end‖";
|
||||
tooltip = $"‖color:{color}‖{tooltip}‖color:end‖";
|
||||
var richTextData = RichTextData.GetRichTextData(tooltip, out string sanitizedTooltip);
|
||||
characterComponent.ToolTip = sanitizedTooltip;
|
||||
characterComponent.TooltipRichTextData = richTextData;
|
||||
@@ -546,7 +558,7 @@ namespace Barotrauma
|
||||
RemoveCharacter(killedCharacter);
|
||||
}
|
||||
|
||||
private IEnumerable<object> KillCharacterAnim(GUIComponent component)
|
||||
private IEnumerable<CoroutineStatus> KillCharacterAnim(GUIComponent component)
|
||||
{
|
||||
List<GUIComponent> components = component.GetAllChildren().ToList();
|
||||
components.Add(component);
|
||||
@@ -1648,7 +1660,7 @@ namespace Barotrauma
|
||||
}
|
||||
if (characterComponent.Visible)
|
||||
{
|
||||
if (character == Character.Controlled && characterComponent.State != GUIComponent.ComponentState.Selected)
|
||||
if (character == Character.Controlled && crewList.SelectedComponent != characterComponent)
|
||||
{
|
||||
crewList.Select(character, force: true);
|
||||
}
|
||||
@@ -2637,7 +2649,7 @@ namespace Barotrauma
|
||||
|
||||
// If targeting a repairable item with condition below the repair threshold, show the 'repairsystems' order
|
||||
orderIdentifier = "repairsystems";
|
||||
if (contextualOrders.None(o => o.Identifier.Equals(orderIdentifier)) && itemContext.Repairables.Any(r => itemContext.ConditionPercentage < r.RepairThreshold))
|
||||
if (contextualOrders.None(o => o.Identifier.Equals(orderIdentifier)) && itemContext.Repairables.Any(r => r.IsBelowRepairThreshold))
|
||||
{
|
||||
if (itemContext.Repairables.Any(r => r != null && r.requiredSkills.Any(s => s != null && s.Identifier.Equals("electrical"))))
|
||||
{
|
||||
@@ -2758,11 +2770,11 @@ namespace Barotrauma
|
||||
if (AIObjectiveCleanupItems.IsValidTarget(item, Character.Controlled, checkInventory: false)) { return true; }
|
||||
if (AIObjectiveCleanupItems.IsValidContainer(item, Character.Controlled)) { return true; }
|
||||
|
||||
if (item.Repairables.Any(r => item.ConditionPercentage < r.RepairThreshold)) { return true; }
|
||||
if (item.Repairables.Any(r => r.IsBelowRepairThreshold)) { return true; }
|
||||
var operateWeaponsPrefab = Order.GetPrefab("operateweapons");
|
||||
return item.Components.Any(c => c is Controller) &&
|
||||
(item.GetConnectedComponents<Turret>().Any(c => c.Item.HasTag(operateWeaponsPrefab.TargetItems)) ||
|
||||
item.GetConnectedComponents<Turret>(recursive: true).Any(c => c.Item.HasTag(operateWeaponsPrefab.TargetItems)));
|
||||
item.GetConnectedComponents<Turret>(recursive: true).Any(c => c.Item.HasTag(operateWeaponsPrefab.TargetItems)));
|
||||
}
|
||||
|
||||
/// <param name="hotkey">Use a negative value (e.g. -1) if there should be no hotkey associated with the node</param>
|
||||
@@ -2781,7 +2793,7 @@ namespace Barotrauma
|
||||
disableNode = !CanCharacterBeHeard();
|
||||
}
|
||||
|
||||
var mustSetOptionOrTarget = order.HasOptions;
|
||||
bool mustSetOptionOrTarget = order.HasOptions;
|
||||
Item orderTargetEntity = null;
|
||||
|
||||
// If the order doesn't have options, but must set a target,
|
||||
@@ -2804,14 +2816,14 @@ namespace Barotrauma
|
||||
{
|
||||
if (disableNode || !CanIssueOrders) { return false; }
|
||||
var o = userData as Order;
|
||||
if (o.MustManuallyAssign && characterContext == null)
|
||||
{
|
||||
CreateAssignmentNodes(node);
|
||||
}
|
||||
else if (mustSetOptionOrTarget)
|
||||
if (mustSetOptionOrTarget)
|
||||
{
|
||||
NavigateForward(button, userData);
|
||||
}
|
||||
else if (o.MustManuallyAssign && characterContext == null)
|
||||
{
|
||||
CreateAssignmentNodes(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (orderTargetEntity != null)
|
||||
@@ -2925,6 +2937,10 @@ namespace Barotrauma
|
||||
{
|
||||
NavigateForward(button, userData);
|
||||
}
|
||||
else if (o.Item1.MustManuallyAssign && characterContext == null)
|
||||
{
|
||||
CreateAssignmentNodes(button);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCharacterOrder(characterContext ?? GetCharacterForQuickAssignment(o.Item1), o.Item1, o.Item2, CharacterInfo.HighestManualOrderPriority, Character.Controlled);
|
||||
@@ -2987,12 +3003,19 @@ namespace Barotrauma
|
||||
var node = new GUIButton(new RectTransform(size, parent: parent, anchor: Anchor.Center), style: null)
|
||||
{
|
||||
UserData = new Tuple<Order, string>(order, option),
|
||||
OnClicked = (_, userData) =>
|
||||
OnClicked = (button, userData) =>
|
||||
{
|
||||
if (!CanIssueOrders) { return false; }
|
||||
var o = userData as Tuple<Order, string>;
|
||||
SetCharacterOrder(characterContext ?? GetCharacterForQuickAssignment(o.Item1), o.Item1, o.Item2, CharacterInfo.HighestManualOrderPriority, Character.Controlled);
|
||||
DisableCommandUI();
|
||||
if (o.Item1.MustManuallyAssign && characterContext == null)
|
||||
{
|
||||
CreateAssignmentNodes(button);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCharacterOrder(characterContext ?? GetCharacterForQuickAssignment(o.Item1), o.Item1, o.Item2, CharacterInfo.HighestManualOrderPriority, Character.Controlled);
|
||||
DisableCommandUI();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
+5
-7
@@ -188,7 +188,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
|
||||
private IEnumerable<object> DoInitialCameraTransition()
|
||||
private IEnumerable<CoroutineStatus> DoInitialCameraTransition()
|
||||
{
|
||||
while (GameMain.Instance.LoadingScreenOpen)
|
||||
{
|
||||
@@ -310,12 +310,12 @@ namespace Barotrauma
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
protected override IEnumerable<object> DoLevelTransition(TransitionType transitionType, LevelData newLevel, Submarine leavingSub, bool mirror, List<TraitorMissionResult> traitorResults = null)
|
||||
protected override IEnumerable<CoroutineStatus> DoLevelTransition(TransitionType transitionType, LevelData newLevel, Submarine leavingSub, bool mirror, List<TraitorMissionResult> traitorResults = null)
|
||||
{
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
private IEnumerable<object> DoLevelTransition()
|
||||
private IEnumerable<CoroutineStatus> DoLevelTransition()
|
||||
{
|
||||
SoundPlayer.OverrideMusicType = CrewManager.GetCharacters().Any(c => !c.IsDead) ? "endround" : "crewdead";
|
||||
SoundPlayer.OverrideMusicDuration = 18.0f;
|
||||
@@ -361,7 +361,7 @@ namespace Barotrauma
|
||||
//--------------------------------------
|
||||
|
||||
//wait for the new level to be loaded
|
||||
DateTime timeOut = DateTime.Now + new TimeSpan(0, 0, seconds: 30);
|
||||
DateTime timeOut = DateTime.Now + new TimeSpan(0, 0, seconds: 60);
|
||||
while (Level.Loaded == prevLevel || Level.Loaded == null)
|
||||
{
|
||||
if (DateTime.Now > timeOut || Screen.Selected != GameMain.GameScreen) { break; }
|
||||
@@ -480,8 +480,6 @@ namespace Barotrauma
|
||||
{
|
||||
IsFirstRound = false;
|
||||
CoroutineManager.StartCoroutine(DoLevelTransition(), "LevelTransition");
|
||||
bool success = CrewManager.GetCharacters().Any(c => !c.IsDead);
|
||||
GUI.SetSavingIndicatorState(success && (Level.IsLoadedOutpost || transitionType != TransitionType.None));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -500,7 +498,7 @@ namespace Barotrauma
|
||||
};
|
||||
}
|
||||
|
||||
private IEnumerable<object> DoEndCampaignCameraTransition()
|
||||
private IEnumerable<CoroutineStatus> DoEndCampaignCameraTransition()
|
||||
{
|
||||
Character controlled = Character.Controlled;
|
||||
if (controlled != null)
|
||||
|
||||
+4
-4
@@ -243,7 +243,7 @@ namespace Barotrauma
|
||||
mirror: map.CurrentLocation != map.SelectedConnection?.Locations[0]));
|
||||
}
|
||||
|
||||
private IEnumerable<object> DoLoadInitialLevel(LevelData level, bool mirror)
|
||||
private IEnumerable<CoroutineStatus> DoLoadInitialLevel(LevelData level, bool mirror)
|
||||
{
|
||||
GameMain.GameSession.StartRound(level,
|
||||
mirrorLevel: mirror);
|
||||
@@ -254,7 +254,7 @@ namespace Barotrauma
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
private IEnumerable<object> DoInitialCameraTransition()
|
||||
private IEnumerable<CoroutineStatus> DoInitialCameraTransition()
|
||||
{
|
||||
while (GameMain.Instance.LoadingScreenOpen)
|
||||
{
|
||||
@@ -378,7 +378,7 @@ namespace Barotrauma
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
protected override IEnumerable<object> DoLevelTransition(TransitionType transitionType, LevelData newLevel, Submarine leavingSub, bool mirror, List<TraitorMissionResult> traitorResults = null)
|
||||
protected override IEnumerable<CoroutineStatus> DoLevelTransition(TransitionType transitionType, LevelData newLevel, Submarine leavingSub, bool mirror, List<TraitorMissionResult> traitorResults = null)
|
||||
{
|
||||
NextLevel = newLevel;
|
||||
bool success = CrewManager.GetCharacters().Any(c => !c.IsDead);
|
||||
@@ -515,7 +515,7 @@ namespace Barotrauma
|
||||
};
|
||||
}
|
||||
|
||||
private IEnumerable<object> DoEndCampaignCameraTransition()
|
||||
private IEnumerable<CoroutineStatus> DoEndCampaignCameraTransition()
|
||||
{
|
||||
if (Character.Controlled != null)
|
||||
{
|
||||
|
||||
+3
-3
@@ -15,7 +15,7 @@ namespace Barotrauma.Tutorials
|
||||
{
|
||||
}
|
||||
|
||||
public override IEnumerable<object> UpdateState()
|
||||
public override IEnumerable<CoroutineStatus> UpdateState()
|
||||
{
|
||||
Character Controlled = Character.Controlled;
|
||||
if (Controlled == null) yield return CoroutineStatus.Success;
|
||||
@@ -634,7 +634,7 @@ namespace Barotrauma.Tutorials
|
||||
return Character.Controlled.Inventory.FindItemByIdentifier(itemIdentifier) != null;
|
||||
}
|
||||
|
||||
protected IEnumerable<object> KeepReactorRunning(Reactor reactor)
|
||||
protected IEnumerable<CoroutineStatus> KeepReactorRunning(Reactor reactor)
|
||||
{
|
||||
do
|
||||
{
|
||||
@@ -652,7 +652,7 @@ namespace Barotrauma.Tutorials
|
||||
/// <summary>
|
||||
/// keeps the enemy away from the sub until the capacitors are loaded
|
||||
/// </summary>
|
||||
private IEnumerable<object> KeepEnemyAway(Character enemy, PowerContainer[] capacitors)
|
||||
private IEnumerable<CoroutineStatus> KeepEnemyAway(Character enemy, PowerContainer[] capacitors)
|
||||
{
|
||||
do
|
||||
{
|
||||
|
||||
+1
-1
@@ -141,7 +141,7 @@ namespace Barotrauma.Tutorials
|
||||
captain_mechanic.AIController.Enabled = captain_security.AIController.Enabled = captain_engineer.AIController.Enabled = false;
|
||||
}
|
||||
|
||||
public override IEnumerable<object> UpdateState()
|
||||
public override IEnumerable<CoroutineStatus> UpdateState()
|
||||
{
|
||||
while (GameMain.Instance.LoadingScreenOpen) yield return null;
|
||||
|
||||
|
||||
+2
-2
@@ -139,7 +139,7 @@ namespace Barotrauma.Tutorials
|
||||
reactorItem.GetComponent<Reactor>().AutoTemp = true;
|
||||
}
|
||||
|
||||
public override IEnumerable<object> UpdateState()
|
||||
public override IEnumerable<CoroutineStatus> UpdateState()
|
||||
{
|
||||
while (GameMain.Instance.LoadingScreenOpen) yield return null;
|
||||
|
||||
@@ -446,7 +446,7 @@ namespace Barotrauma.Tutorials
|
||||
CoroutineManager.StartCoroutine(TutorialCompleted());
|
||||
}
|
||||
|
||||
public IEnumerable<object> KeepPatientAlive(Character patient)
|
||||
public IEnumerable<CoroutineStatus> KeepPatientAlive(Character patient)
|
||||
{
|
||||
while (patient != null && !patient.Removed)
|
||||
{
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ namespace Barotrauma.Tutorials
|
||||
{
|
||||
}
|
||||
|
||||
public override IEnumerable<object> UpdateState()
|
||||
public override IEnumerable<CoroutineStatus> UpdateState()
|
||||
{
|
||||
/*infoBox = CreateInfoFrame("Use the mouse wheel to zoom in and out, and WASD to move the camera around.", true);
|
||||
|
||||
|
||||
+7
-7
@@ -206,7 +206,7 @@ namespace Barotrauma.Tutorials
|
||||
engineer_submarineJunctionBox_3.Condition = 0f;
|
||||
}
|
||||
|
||||
public override IEnumerable<object> UpdateState()
|
||||
public override IEnumerable<CoroutineStatus> UpdateState()
|
||||
{
|
||||
while (GameMain.Instance.LoadingScreenOpen) yield return null;
|
||||
|
||||
@@ -378,7 +378,7 @@ namespace Barotrauma.Tutorials
|
||||
}
|
||||
}
|
||||
yield return null;
|
||||
} while (engineer_brokenJunctionBox.Condition < repairableJunctionBoxComponent.RepairThreshold); // Wait until repaired
|
||||
} while (repairableJunctionBoxComponent.IsBelowRepairThreshold); // Wait until repaired
|
||||
SetHighlight(engineer_brokenJunctionBox, false);
|
||||
RemoveCompletedObjective(segments[3]);
|
||||
SetDoorAccess(engineer_thirdDoor, engineer_thirdDoorLight, true);
|
||||
@@ -422,7 +422,7 @@ namespace Barotrauma.Tutorials
|
||||
Repairable repairableJunctionBoxComponent3 = engineer_submarineJunctionBox_3.GetComponent<Repairable>();
|
||||
|
||||
// Remove highlights when each individual machine is repaired
|
||||
do { CheckJunctionBoxHighlights(repairableJunctionBoxComponent1, repairableJunctionBoxComponent2, repairableJunctionBoxComponent3); yield return null; } while (engineer_submarineJunctionBox_1.Condition < repairableJunctionBoxComponent1.RepairThreshold || engineer_submarineJunctionBox_2.Condition < repairableJunctionBoxComponent2.RepairThreshold || engineer_submarineJunctionBox_3.Condition < repairableJunctionBoxComponent3.RepairThreshold);
|
||||
do { CheckJunctionBoxHighlights(repairableJunctionBoxComponent1, repairableJunctionBoxComponent2, repairableJunctionBoxComponent3); yield return null; } while (repairableJunctionBoxComponent1.IsBelowRepairThreshold || repairableJunctionBoxComponent2.IsBelowRepairThreshold || repairableJunctionBoxComponent3.IsBelowRepairThreshold);
|
||||
CheckJunctionBoxHighlights(repairableJunctionBoxComponent1, repairableJunctionBoxComponent2, repairableJunctionBoxComponent3);
|
||||
RemoveCompletedObjective(segments[5]);
|
||||
yield return new WaitForSeconds(2f, false);
|
||||
@@ -462,7 +462,7 @@ namespace Barotrauma.Tutorials
|
||||
return engineer?.SelectedConstruction == item;
|
||||
}
|
||||
|
||||
private IEnumerable<object> ReactorOperatedProperly()
|
||||
private IEnumerable<CoroutineStatus> ReactorOperatedProperly()
|
||||
{
|
||||
float timer;
|
||||
|
||||
@@ -566,17 +566,17 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
private void CheckJunctionBoxHighlights(Repairable comp1, Repairable comp2, Repairable comp3)
|
||||
{
|
||||
if (engineer_submarineJunctionBox_1.Condition > comp1.RepairThreshold && engineer_submarineJunctionBox_1.ExternalHighlight)
|
||||
if (!comp1.IsBelowRepairThreshold && engineer_submarineJunctionBox_1.ExternalHighlight)
|
||||
{
|
||||
SetHighlight(engineer_submarineJunctionBox_1, false);
|
||||
engineer.RemoveActiveObjectiveEntity(engineer_submarineJunctionBox_1);
|
||||
}
|
||||
if (engineer_submarineJunctionBox_2.Condition > comp2.RepairThreshold && engineer_submarineJunctionBox_2.ExternalHighlight)
|
||||
if (!comp2.IsBelowRepairThreshold && engineer_submarineJunctionBox_2.ExternalHighlight)
|
||||
{
|
||||
SetHighlight(engineer_submarineJunctionBox_2, false);
|
||||
engineer.RemoveActiveObjectiveEntity(engineer_submarineJunctionBox_2);
|
||||
}
|
||||
if (engineer_submarineJunctionBox_3.Condition > comp3.RepairThreshold && engineer_submarineJunctionBox_3.ExternalHighlight)
|
||||
if (!comp3.IsBelowRepairThreshold && engineer_submarineJunctionBox_3.ExternalHighlight)
|
||||
{
|
||||
SetHighlight(engineer_submarineJunctionBox_3, false);
|
||||
engineer.RemoveActiveObjectiveEntity(engineer_submarineJunctionBox_3);
|
||||
|
||||
+7
-7
@@ -225,7 +225,7 @@ namespace Barotrauma.Tutorials
|
||||
base.Update(deltaTime);
|
||||
}
|
||||
|
||||
public override IEnumerable<object> UpdateState()
|
||||
public override IEnumerable<CoroutineStatus> UpdateState()
|
||||
{
|
||||
while (GameMain.Instance.LoadingScreenOpen) yield return null;
|
||||
|
||||
@@ -550,7 +550,7 @@ namespace Barotrauma.Tutorials
|
||||
do
|
||||
{
|
||||
yield return null;
|
||||
if (mechanic_brokenPump.Item.Condition < repairablePumpComponent.RepairThreshold)
|
||||
if (repairablePumpComponent.IsBelowRepairThreshold)
|
||||
{
|
||||
if (!mechanic.HasEquippedItem("wrench"))
|
||||
{
|
||||
@@ -574,7 +574,7 @@ namespace Barotrauma.Tutorials
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (mechanic_brokenPump.Item.Condition < repairablePumpComponent.RepairThreshold || mechanic_brokenPump.FlowPercentage >= 0 || !mechanic_brokenPump.IsActive);
|
||||
} while (repairablePumpComponent.IsBelowRepairThreshold || mechanic_brokenPump.FlowPercentage >= 0 || !mechanic_brokenPump.IsActive);
|
||||
RemoveCompletedObjective(segments[9]);
|
||||
SetHighlight(mechanic_brokenPump.Item, false);
|
||||
do { yield return null; } while (mechanic_brokenhull_2.WaterPercentage > waterVolumeBeforeOpening);
|
||||
@@ -597,7 +597,7 @@ namespace Barotrauma.Tutorials
|
||||
Repairable repairableEngineComponent = mechanic_submarineEngine.Item.GetComponent<Repairable>();
|
||||
|
||||
// Remove highlights when each individual machine is repaired
|
||||
do { CheckHighlights(repairablePumpComponent1, repairablePumpComponent2, repairableEngineComponent); yield return null; } while (mechanic_ballastPump_1.Item.Condition < repairablePumpComponent1.RepairThreshold || mechanic_ballastPump_2.Item.Condition < repairablePumpComponent2.RepairThreshold || mechanic_submarineEngine.Item.Condition < repairableEngineComponent.RepairThreshold);
|
||||
do { CheckHighlights(repairablePumpComponent1, repairablePumpComponent2, repairableEngineComponent); yield return null; } while (repairablePumpComponent1.IsBelowRepairThreshold || repairablePumpComponent2.IsBelowRepairThreshold || repairableEngineComponent.IsBelowRepairThreshold);
|
||||
CheckHighlights(repairablePumpComponent1, repairablePumpComponent2, repairableEngineComponent);
|
||||
RemoveCompletedObjective(segments[10]);
|
||||
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Mechanic.Radio.Complete"), ChatMessageType.Radio, null);
|
||||
@@ -623,17 +623,17 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
private void CheckHighlights(Repairable comp1, Repairable comp2, Repairable comp3)
|
||||
{
|
||||
if (mechanic_ballastPump_1.Item.Condition > comp1.RepairThreshold && mechanic_ballastPump_1.Item.ExternalHighlight)
|
||||
if (!comp1.IsBelowRepairThreshold && mechanic_ballastPump_1.Item.ExternalHighlight)
|
||||
{
|
||||
SetHighlight(mechanic_ballastPump_1.Item, false);
|
||||
mechanic.RemoveActiveObjectiveEntity(mechanic_ballastPump_1.Item);
|
||||
}
|
||||
if (mechanic_ballastPump_2.Item.Condition > comp2.RepairThreshold && mechanic_ballastPump_2.Item.ExternalHighlight)
|
||||
if (!comp2.IsBelowRepairThreshold && mechanic_ballastPump_2.Item.ExternalHighlight)
|
||||
{
|
||||
SetHighlight(mechanic_ballastPump_2.Item, false);
|
||||
mechanic.RemoveActiveObjectiveEntity(mechanic_ballastPump_2.Item);
|
||||
}
|
||||
if (mechanic_submarineEngine.Item.Condition > comp3.RepairThreshold && mechanic_submarineEngine.Item.ExternalHighlight)
|
||||
if (!comp3.IsBelowRepairThreshold && mechanic_submarineEngine.Item.ExternalHighlight)
|
||||
{
|
||||
SetHighlight(mechanic_submarineEngine.Item, false);
|
||||
mechanic.RemoveActiveObjectiveEntity(mechanic_submarineEngine.Item);
|
||||
|
||||
+1
-1
@@ -201,7 +201,7 @@ namespace Barotrauma.Tutorials
|
||||
SetDoorAccess(tutorial_submarineDoor, tutorial_submarineDoorLight, true);
|
||||
}
|
||||
|
||||
public override IEnumerable<object> UpdateState()
|
||||
public override IEnumerable<CoroutineStatus> UpdateState()
|
||||
{
|
||||
while (GameMain.Instance.LoadingScreenOpen) yield return null;
|
||||
|
||||
|
||||
+3
-3
@@ -54,7 +54,7 @@ namespace Barotrauma.Tutorials
|
||||
GameMain.Instance.ShowLoading(Loading());
|
||||
}
|
||||
|
||||
private IEnumerable<object> Loading()
|
||||
private IEnumerable<CoroutineStatus> Loading()
|
||||
{
|
||||
SubmarineInfo subInfo = new SubmarineInfo(submarinePath);
|
||||
|
||||
@@ -259,7 +259,7 @@ namespace Barotrauma.Tutorials
|
||||
base.Stop();
|
||||
}
|
||||
|
||||
private IEnumerable<object> Dead()
|
||||
private IEnumerable<CoroutineStatus> Dead()
|
||||
{
|
||||
GUI.PreventPauseMenuToggle = true;
|
||||
Character.Controlled = character = null;
|
||||
@@ -279,7 +279,7 @@ namespace Barotrauma.Tutorials
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
protected IEnumerable<object> TutorialCompleted()
|
||||
protected IEnumerable<CoroutineStatus> TutorialCompleted()
|
||||
{
|
||||
GUI.PreventPauseMenuToggle = true;
|
||||
|
||||
|
||||
+2
-2
@@ -247,7 +247,7 @@ namespace Barotrauma.Tutorials
|
||||
}
|
||||
}
|
||||
|
||||
public virtual IEnumerable<object> UpdateState()
|
||||
public virtual IEnumerable<CoroutineStatus> UpdateState()
|
||||
{
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
@@ -470,7 +470,7 @@ namespace Barotrauma.Tutorials
|
||||
CoroutineManager.StartCoroutine(WaitForObjectiveEnd(segment));
|
||||
}
|
||||
|
||||
private IEnumerable<object> WaitForObjectiveEnd(TutorialSegment objective)
|
||||
private IEnumerable<CoroutineStatus> WaitForObjectiveEnd(TutorialSegment objective)
|
||||
{
|
||||
yield return new WaitForSeconds(2.0f);
|
||||
objectiveFrame.RemoveChild(objective.ReplayButton);
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ namespace Barotrauma
|
||||
foreach (Item item in Item.ItemList)
|
||||
{
|
||||
//don't consider the items to belong in the outpost to prevent the stealing icon from showing
|
||||
item.SpawnedInOutpost = false;
|
||||
item.SpawnedInCurrentOutpost = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,8 @@ namespace Barotrauma
|
||||
respawnButtonContainer = new GUILayoutGroup(new RectTransform(new Vector2(0.5f, 1.0f), respawnInfoFrame.RectTransform, Anchor.CenterRight), isHorizontal: true, childAnchor: Anchor.CenterLeft)
|
||||
{
|
||||
AbsoluteSpacing = HUDLayoutSettings.Padding,
|
||||
Stretch = true
|
||||
Stretch = true,
|
||||
Visible = false
|
||||
};
|
||||
respawnTickBox = new GUITickBox(new RectTransform(Vector2.One * 0.9f, respawnButtonContainer.RectTransform, Anchor.Center), TextManager.Get("respawnquestionpromptrespawn"))
|
||||
{
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace Barotrauma
|
||||
string hintIdentifierBase = "onstartedinteracting";
|
||||
|
||||
// onstartedinteracting.brokenitem
|
||||
if (item.Repairables.Any(r => item.ConditionPercentage < r.RepairThreshold))
|
||||
if (item.Repairables.Any(r => r.IsBelowRepairThreshold))
|
||||
{
|
||||
if (DisplayHint($"{hintIdentifierBase}.brokenitem")) { return; }
|
||||
}
|
||||
@@ -192,7 +192,7 @@ namespace Barotrauma
|
||||
if (!CanDisplayHints(requireGameScreen: false, requireControllingCharacter: false)) { return; }
|
||||
CoroutineManager.StartCoroutine(DisplayRoundStartedHints(initRoundHandle), "HintManager.DisplayRoundStartedHints");
|
||||
|
||||
static IEnumerable<object> InitRound()
|
||||
static IEnumerable<CoroutineStatus> InitRound()
|
||||
{
|
||||
while (Character.Controlled == null) { yield return CoroutineStatus.Running; }
|
||||
// Get the ballast hulls on round start not to find them again and again later
|
||||
@@ -211,7 +211,7 @@ namespace Barotrauma
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
static IEnumerable<object> DisplayRoundStartedHints(CoroutineHandle initRoundHandle)
|
||||
static IEnumerable<CoroutineStatus> DisplayRoundStartedHints(CoroutineHandle initRoundHandle)
|
||||
{
|
||||
while (GameMain.Instance.LoadingScreenOpen || Screen.Selected != GameMain.GameScreen ||
|
||||
CoroutineManager.IsCoroutineRunning(initRoundHandle) ||
|
||||
|
||||
Reference in New Issue
Block a user