Added a property for locking connection panels (better than the old hacky way of changing the required item to something else). Locked panels can still be rewired in the sub editor. Closes #679

This commit is contained in:
Joonas Rikkonen
2018-08-20 20:12:33 +03:00
parent 3747852c13
commit 898e8dfdb1
2 changed files with 32 additions and 19 deletions
@@ -14,7 +14,14 @@ namespace Barotrauma.Items.Components
public List<Connection> Connections;
Character user;
private Character user;
[Serialize(false, true), Editable(ToolTip = "Locked connection panels cannot be rewired in-game.")]
public bool Locked
{
get;
set;
}
public ConnectionPanel(Item item, XElement element)
: base(item, element)
@@ -180,6 +187,9 @@ namespace Barotrauma.Items.Components
}
}
}
//don't allow rewiring locked panels
if (Locked) return;
item.CreateServerEvent(this);