Wiring syncing

This commit is contained in:
Regalis
2017-01-27 20:59:41 +02:00
parent 4589c2bcfb
commit 0570956e24
4 changed files with 161 additions and 28 deletions
@@ -145,7 +145,6 @@ namespace Barotrauma.Items.Components
if (Wires[i] == null)
{
Wires[i] = wire;
UpdateRecipients();
return;
}
}
@@ -154,14 +153,8 @@ namespace Barotrauma.Items.Components
public void AddLink(int index, Wire wire)
{
Wires[index] = wire;
UpdateRecipients();
}
public void UpdateRecipients()
{
}
public void SendSignal(int stepsTaken, string signal, Item sender, float power)
{
for (int i = 0; i < MaxLinked; i++)
@@ -286,8 +279,15 @@ namespace Barotrauma.Items.Components
if (!PlayerInput.LeftButtonHeld())
{
//panel.Item.NewComponentEvent(panel, true, true);
//draggingConnected.Drop(Character);
if (GameMain.Client != null)
{
panel.Item.CreateClientEvent<ConnectionPanel>(panel);
}
else if (GameMain.Server != null)
{
panel.Item.CreateServerEvent<ConnectionPanel>(panel);
}
draggingConnected = null;
}
}
@@ -464,8 +464,7 @@ namespace Barotrauma.Items.Components
public void ConnectLinked()
{
if (wireId == null) return;
for (int i = 0; i < MaxLinked; i++)
{
if (wireId[i] == 0) continue;
@@ -481,10 +480,6 @@ namespace Barotrauma.Items.Components
Wires[i].Connect(this, false, true);
}
}
UpdateRecipients();
//wireId = null;
}
}