Some new wall sprites, wires are automatically dropped if both items they're attached to are removed, other items aren't highlighted while dragging an item in editor
This commit is contained in:
@@ -118,6 +118,26 @@ namespace Barotrauma.Items.Components
|
||||
loadedConnections[i].wireId.CopyTo(Connections[i].wireId, 0);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void RemoveComponentSpecific()
|
||||
{
|
||||
foreach (Connection c in Connections)
|
||||
{
|
||||
foreach (Wire wire in c.Wires)
|
||||
{
|
||||
if (wire == null) continue;
|
||||
|
||||
if (wire.OtherConnection(c) == null) //wire not connected to anything else
|
||||
{
|
||||
wire.Item.Drop(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
wire.RemoveConnection(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool FillNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetBuffer message)
|
||||
{
|
||||
|
||||
@@ -23,6 +23,11 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
private static Wire draggingWire;
|
||||
private static int? selectedNodeIndex;
|
||||
|
||||
public Connection[] Connections
|
||||
{
|
||||
get { return connections; }
|
||||
}
|
||||
|
||||
public Wire(Item item, XElement element)
|
||||
: base(item, element)
|
||||
|
||||
Reference in New Issue
Block a user