v1.5.7.0 (Summer Update)
This commit is contained in:
@@ -303,6 +303,17 @@ namespace Barotrauma.Items.Components
|
||||
CreateClientEvent(new CircuitBoxRenameLabelEvent(label.ID, color, header, body));
|
||||
}
|
||||
|
||||
public void SetConnectionLabelOverrides(CircuitBoxInputOutputNode node, Dictionary<string, string> newOverrides)
|
||||
{
|
||||
if (GameMain.NetworkMember is null)
|
||||
{
|
||||
node.ReplaceAllConnectionLabelOverrides(newOverrides);
|
||||
return;
|
||||
}
|
||||
|
||||
CreateClientEvent(new CircuitBoxRenameConnectionLabelsEvent(node.NodeType, newOverrides.ToNetDictionary()));
|
||||
}
|
||||
|
||||
public void ResizeNode(CircuitBoxNode node, CircuitBoxResizeDirection dir, Vector2 amount)
|
||||
{
|
||||
if (Locked) { return; }
|
||||
@@ -528,6 +539,12 @@ namespace Barotrauma.Items.Components
|
||||
_ => node.Position
|
||||
};
|
||||
}
|
||||
|
||||
foreach (var labelOverride in data.LabelOverrides)
|
||||
{
|
||||
RenameConnectionLabelsInternal(labelOverride.Type, labelOverride.Override.ToDictionary());
|
||||
}
|
||||
|
||||
wasInitializedByServer = true;
|
||||
break;
|
||||
}
|
||||
@@ -556,6 +573,12 @@ namespace Barotrauma.Items.Components
|
||||
ResizeLabelInternal(data.ID, data.Position, data.Size);
|
||||
break;
|
||||
}
|
||||
case CircuitBoxOpcode.RenameConnections:
|
||||
{
|
||||
var data = INetSerializableStruct.Read<CircuitBoxRenameConnectionLabelsEvent>(msg);
|
||||
RenameConnectionLabelsInternal(data.Type, data.Override.ToDictionary());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(header), header, "This opcode cannot be handled using entity events");
|
||||
}
|
||||
|
||||
@@ -292,8 +292,17 @@ namespace Barotrauma.Items.Components
|
||||
if (wire.HiddenInGame && Screen.Selected == GameMain.GameScreen) { continue; }
|
||||
|
||||
Connection recipient = wire.OtherConnection(this);
|
||||
LocalizedString label = recipient == null ? "" : recipient.item.Name + $" ({recipient.DisplayName})";
|
||||
if (wire.Locked) { label += "\n" + TextManager.Get("ConnectionLocked"); }
|
||||
LocalizedString label;
|
||||
if (wire.Item.IsLayerHidden)
|
||||
{
|
||||
label = TextManager.Get("ConnectionLocked");
|
||||
}
|
||||
else
|
||||
{
|
||||
label = recipient == null ? "" : recipient.item.Name + $" ({recipient.DisplayName})";
|
||||
if (wire.Locked) { label += "\n" + TextManager.Get("ConnectionLocked"); }
|
||||
}
|
||||
|
||||
DrawWire(spriteBatch, wire, position, wirePosition, equippedWire, panel, label);
|
||||
|
||||
wirePosition.Y += wireInterval;
|
||||
@@ -494,7 +503,7 @@ namespace Barotrauma.Items.Components
|
||||
ConnectionPanel.HighlightedWire = wire;
|
||||
|
||||
bool allowRewiring = GameMain.NetworkMember?.ServerSettings == null || GameMain.NetworkMember.ServerSettings.AllowRewiring || panel.AlwaysAllowRewiring;
|
||||
if (allowRewiring && (!wire.Locked && !panel.Locked && !panel.TemporarilyLocked || Screen.Selected == GameMain.SubEditorScreen))
|
||||
if (allowRewiring && (!wire.Locked && !wire.Item.IsLayerHidden && !panel.Locked && !panel.TemporarilyLocked || Screen.Selected == GameMain.SubEditorScreen))
|
||||
{
|
||||
//start dragging the wire
|
||||
if (PlayerInput.PrimaryMouseButtonHeld()) { DraggingConnected = wire; }
|
||||
|
||||
Reference in New Issue
Block a user