- fixed light components throwing errors when receiving an invalid color value to the "set_color" input

- fixed it being possible to connect wires to more than two items by selecting another item while dragging the wire
- relay components break if too much power is directed through them
- relay components are active by default and the can be toggled on/off in the editor
- bool properties show as checkboxes in the editor
This commit is contained in:
Regalis
2016-03-17 19:16:21 +02:00
parent d6a57f9533
commit 20d61b0647
6 changed files with 120 additions and 60 deletions
@@ -333,30 +333,16 @@ namespace Barotrauma.Items.Components
int index = FindWireIndex(null);
Wire wireComponent = draggingConnected.GetComponent<Wire>();
if (index>-1 && wireComponent!=null && !Wires.Contains(wireComponent))
if (index > -1 && wireComponent != null && !Wires.Contains(wireComponent))
{
bool alreadyConnected = wireComponent.IsConnectedTo(item);
wireComponent.RemoveConnection(item);
Wires[index] = wireComponent;
wireComponent.Connect(this, !alreadyConnected);
if (wireComponent.Connect(this, !alreadyConnected)) Wires[index] = wireComponent;
}
}
//far away -> disconnect if the wire is linked to this connector
else
{
//int index = FindWireIndex(draggingConnected);
//if (index>-1)
//{
// Wires[index].RemoveConnection(this);
// //Wires[index].Item.SetTransform(item.SimPosition, 0.0f);
// //Wires[index].Item.Drop();
// //Wires[index].Item.body.Enabled = true;
// Wires[index] = null;
//}
}
}
}
int screwIndex = (position.Y % 60 < 30) ? 0 : 1;