This commit is contained in:
kmyuhkyuk
2026-03-23 08:58:30 +08:00
parent 72a9266e97
commit 5a9b05288a
2 changed files with 6 additions and 6 deletions
@@ -32,7 +32,7 @@ namespace SlayTheSpire2.LAN.Multiplayer.Components
base._Ready(); base._Ready();
} }
public void ShowWithPosition(Vector2 position) public void ShowWithGlobalPosition(Vector2 position)
{ {
_tween?.Kill(); _tween?.Kill();
@@ -193,7 +193,7 @@ namespace SlayTheSpire2.LAN.Multiplayer.Components
!string.IsNullOrEmpty(_ipAddressLabel.Text)) !string.IsNullOrEmpty(_ipAddressLabel.Text))
{ {
DisplayServer.ClipboardSet(_ipAddressLabel.Text); DisplayServer.ClipboardSet(_ipAddressLabel.Text);
_copiedLabel.ShowWithPosition(inputEventMouseButton.GlobalPosition); _copiedLabel.ShowWithGlobalPosition(inputEventMouseButton.GlobalPosition);
} }
}; };
@@ -210,7 +210,7 @@ namespace SlayTheSpire2.LAN.Multiplayer.Components
!string.IsNullOrEmpty(_ipv6AddressLabel.Text)) !string.IsNullOrEmpty(_ipv6AddressLabel.Text))
{ {
DisplayServer.ClipboardSet(_ipv6AddressLabel.Text); DisplayServer.ClipboardSet(_ipv6AddressLabel.Text);
_copiedLabel.ShowWithPosition(inputEventMouseButton.GlobalPosition); _copiedLabel.ShowWithGlobalPosition(inputEventMouseButton.GlobalPosition);
} }
}; };
@@ -304,6 +304,8 @@ namespace SlayTheSpire2.LAN.Multiplayer.Components
ipAddressLabel.SetTextAutoSize($"{localIPAddress}:{port}"); ipAddressLabel.SetTextAutoSize($"{localIPAddress}:{port}");
_localIPAddressContainer.AddChildSafely(ipAddressLabel);
ipAddressLabel.GuiInput += inputEvent => ipAddressLabel.GuiInput += inputEvent =>
{ {
if (inputEvent is InputEventMouseButton if (inputEvent is InputEventMouseButton
@@ -313,12 +315,10 @@ namespace SlayTheSpire2.LAN.Multiplayer.Components
!string.IsNullOrEmpty(ipAddressLabel.Text)) !string.IsNullOrEmpty(ipAddressLabel.Text))
{ {
DisplayServer.ClipboardSet(ipAddressLabel.Text); DisplayServer.ClipboardSet(ipAddressLabel.Text);
_copiedLabel?.ShowWithPosition(inputEventMouseButton.GlobalPosition); _copiedLabel?.ShowWithGlobalPosition(inputEventMouseButton.GlobalPosition);
} }
}; };
_localIPAddressContainer.AddChildSafely(ipAddressLabel);
hasLocalIPAddress = true; hasLocalIPAddress = true;
} }
} }