Unstable 1.8.4.0
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#nullable enable
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -82,8 +82,13 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public bool IsFull => ComponentContainer?.Inventory is { } inventory && inventory.IsFull(true);
|
||||
|
||||
/// <summary>
|
||||
/// Works the same way as the Locked property, but isn't persistent.
|
||||
/// </summary>
|
||||
public bool TemporarilyLocked;
|
||||
|
||||
[Editable, Serialize(false, IsPropertySaveable.Yes, description: "Locked circuit boxes can only be viewed and not interacted with.")]
|
||||
public bool Locked { get; set; }
|
||||
public bool Locked { get; private set; }
|
||||
|
||||
public CircuitBox(Item item, ContentXElement element) : base(item, element)
|
||||
{
|
||||
@@ -635,6 +640,18 @@ namespace Barotrauma.Items.Components
|
||||
OnViewUpdateProjSpecific();
|
||||
}
|
||||
|
||||
public void RemoveWire(Wire wireItem)
|
||||
{
|
||||
foreach (CircuitBoxWire wire in Wires.ToImmutableArray())
|
||||
{
|
||||
if (wire.BackingWire.TryUnwrap(out var backingWire) && backingWire == wireItem.Item)
|
||||
{
|
||||
RemoveWireCollectionUnsafe(wire);
|
||||
}
|
||||
}
|
||||
OnViewUpdateProjSpecific();
|
||||
}
|
||||
|
||||
private void RemoveWireCollectionUnsafe(CircuitBoxWire wire)
|
||||
{
|
||||
foreach (CircuitBoxOutputConnection output in Outputs)
|
||||
@@ -756,6 +773,8 @@ namespace Barotrauma.Items.Components
|
||||
_ => true
|
||||
};
|
||||
|
||||
public bool IsLocked() => Locked || TemporarilyLocked;
|
||||
|
||||
public static Option<Item> GetApplicableResourcePlayerHas(ItemPrefab prefab, Character? character)
|
||||
{
|
||||
if (character is null) { return Option.None; }
|
||||
|
||||
Reference in New Issue
Block a user