Unstable 0.16.0.0
This commit is contained in:
@@ -46,6 +46,7 @@ namespace Barotrauma.Items.Components
|
||||
child.Enabled = buttonsEnabled;
|
||||
child.Children.ForEach(c => c.Enabled = buttonsEnabled);
|
||||
}
|
||||
if (Container == null) { return; }
|
||||
bool itemsContained = Container.Inventory.AllItems.Any();
|
||||
if (itemsContained)
|
||||
{
|
||||
@@ -77,7 +78,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
if (GameMain.IsSingleplayer)
|
||||
{
|
||||
SendSignal((int)userData);
|
||||
SendSignal((int)userData, Character.Controlled);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -98,6 +99,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
partial void OnItemLoadedProjSpecific()
|
||||
{
|
||||
if (Container == null) { return; }
|
||||
Container.AllowUIOverlap = true;
|
||||
Container.Inventory.RectTransform = containerHolder.RectTransform;
|
||||
}
|
||||
@@ -109,7 +111,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public void ClientRead(ServerNetObject type, IReadMessage msg, float sendingTime)
|
||||
{
|
||||
SendSignal(msg.ReadRangedInteger(0, Signals.Length - 1), isServerMessage: true);
|
||||
SendSignal(msg.ReadRangedInteger(0, Signals.Length - 1), sender: null, isServerMessage: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,7 +197,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
partial void UpdateProjSpecific()
|
||||
public override void UpdateHUD(Character character, float deltaTime, Camera cam)
|
||||
{
|
||||
bool elementVisibilityChanged = false;
|
||||
int visibleElementCount = 0;
|
||||
@@ -209,6 +209,7 @@ namespace Barotrauma.Items.Components
|
||||
if (uiElement.Visible != visible)
|
||||
{
|
||||
uiElement.Visible = visible;
|
||||
uiElement.IgnoreLayoutGroups = !uiElement.Visible;
|
||||
elementVisibilityChanged = true;
|
||||
}
|
||||
}
|
||||
@@ -223,6 +224,7 @@ namespace Barotrauma.Items.Components
|
||||
uiElement.RectTransform.RelativeSize = new Vector2(1.0f, elementSize);
|
||||
}
|
||||
GuiFrame.Visible = visibleElementCount > 0;
|
||||
uiElementContainer.Recalculate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public void Draw(SpriteBatch spriteBatch, bool editing, float itemDepth = -1)
|
||||
{
|
||||
if (!editing || !MapEntity.SelectedList.Contains(item)) return;
|
||||
if (!editing || !MapEntity.SelectedList.Contains(item)) { return; }
|
||||
|
||||
Vector2 pos = item.WorldPosition + detectOffset;
|
||||
Vector2 pos = item.WorldPosition + TransformedDetectOffset;
|
||||
pos.Y = -pos.Y;
|
||||
GUI.DrawRectangle(spriteBatch, pos - new Vector2(rangeX, rangeY), new Vector2(rangeX, rangeY) * 2.0f, Color.Cyan * 0.5f, isFilled: false, thickness: 2);
|
||||
}
|
||||
|
||||
@@ -286,7 +286,6 @@ namespace Barotrauma.Items.Components
|
||||
item.Color, depth, 0.3f);
|
||||
}
|
||||
|
||||
|
||||
public static void UpdateEditing(List<Wire> wires)
|
||||
{
|
||||
var doubleClicked = PlayerInput.DoubleClicked();
|
||||
@@ -509,6 +508,31 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
public override void Move(Vector2 amount)
|
||||
{
|
||||
//only used in the sub editor, hence only in the client project
|
||||
if (!item.IsSelected) { return; }
|
||||
|
||||
Vector2 wireNodeOffset = item.Submarine == null ? Vector2.Zero : item.Submarine.HiddenSubPosition + amount;
|
||||
for (int i = 0; i < nodes.Count; i++)
|
||||
{
|
||||
if (i == 0 || i == nodes.Count - 1)
|
||||
{
|
||||
if (connections[0]?.Item != null && !connections[0].Item.IsSelected &&
|
||||
(Submarine.RectContains(connections[0].Item.Rect, nodes[i] + wireNodeOffset) || Submarine.RectContains(connections[0].Item.Rect, nodes[i] + wireNodeOffset - amount)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if (connections[1]?.Item != null && !connections[1].Item.IsSelected &&
|
||||
(Submarine.RectContains(connections[1].Item.Rect, nodes[i] + wireNodeOffset) || Submarine.RectContains(connections[1].Item.Rect, nodes[i] + wireNodeOffset - amount)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
nodes[i] += amount;
|
||||
}
|
||||
UpdateSections();
|
||||
}
|
||||
public bool IsMouseOn()
|
||||
{
|
||||
if (GUI.MouseOn == null)
|
||||
|
||||
Reference in New Issue
Block a user