2f107db...5202af9

This commit is contained in:
Joonas Rikkonen
2019-03-18 21:42:26 +02:00
parent 58c92888b7
commit 044fd3344b
395 changed files with 27417 additions and 19754 deletions
@@ -108,10 +108,6 @@ namespace Barotrauma.Items.Components
{
panel.Item.CreateClientEvent(panel);
}
else if (GameMain.Server != null)
{
panel.Item.CreateServerEvent(panel);
}
draggingConnected = null;
}
@@ -173,6 +169,8 @@ namespace Barotrauma.Items.Components
if (draggingConnected.Connect(this, !alreadyConnected, true))
{
var otherConnection = draggingConnected.OtherConnection(this);
#if SERVER
//TODO: ffs
if (otherConnection == null)
{
GameServer.Log(Character.Controlled.LogName + " connected a wire to " +
@@ -183,6 +181,7 @@ namespace Barotrauma.Items.Components
GameServer.Log(Character.Controlled.LogName + " connected a wire from " +
Item.Name + " (" + Name + ") to " + otherConnection.item.Name + " (" + otherConnection.Name + ")", ServerLog.MessageType.ItemInteraction);
}
#endif
SetWire(index, draggingConnected);
}
@@ -54,7 +54,7 @@ namespace Barotrauma.Items.Components
}
else
{
GameMain.Client.CreateEntityEvent(item, new object[] { NetEntityEvent.Type.ComponentState, item.components.IndexOf(this), userdata as CustomInterfaceElement });
GameMain.Client.CreateEntityEvent(item, new object[] { NetEntityEvent.Type.ComponentState, item.GetComponentIndex(this), userdata as CustomInterfaceElement });
}
return true;
};
@@ -5,6 +5,11 @@ namespace Barotrauma.Items.Components
{
partial class MotionSensor : IDrawableComponent
{
public Vector2 DrawSize
{
get { return new Vector2(rangeX, rangeY) * 2.0f; }
}
public void Draw(SpriteBatch spriteBatch, bool editing)
{
if (!editing || !MapEntity.SelectedList.Contains(item)) return;
@@ -5,6 +5,11 @@ namespace Barotrauma.Items.Components
{
partial class WifiComponent : IDrawableComponent
{
public Vector2 DrawSize
{
get { return new Vector2(range * 2); }
}
public void Draw(SpriteBatch spriteBatch, bool editing)
{
if (!editing || !MapEntity.SelectedList.Contains(item)) return;
@@ -41,7 +41,12 @@ namespace Barotrauma.Items.Components
private static Wire draggingWire;
private static int? selectedNodeIndex;
private static int? highlightedNodeIndex;
public Vector2 DrawSize
{
get { return sectionExtents; }
}
public void Draw(SpriteBatch spriteBatch, bool editing)
{
if (sections.Count == 0 && !IsActive || Hidden)