]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix context menu for admin menu (#20030)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Tue, 12 Sep 2023 04:34:20 +0000 (14:34 +1000)
committerGitHub <noreply@github.com>
Tue, 12 Sep 2023 04:34:20 +0000 (14:34 +1000)
Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs
Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTabEntry.xaml.cs
Content.Client/UserInterface/Systems/Admin/AdminUIController.cs

index 91a453e416d699cb398fd48a4950d94791c1933d..29f70057544c0330d3b5c5c55d806eb42fa566e5 100644 (file)
@@ -121,7 +121,7 @@ namespace Content.Client.Administration.UI.Tabs.PlayerTab
                     player.Antag ? "YES" : "NO",
                     new StyleBoxFlat(useAltColor ? _altColor : _defaultColor),
                     player.Connected);
-                entry.PlayerUid = _entManager.GetEntity(player.NetEntity);
+                entry.PlayerEntity = player.NetEntity;
                 entry.OnPressed += args => OnEntryPressed?.Invoke(args);
                 PlayerList.AddChild(entry);
 
index 45cb4b77034c7ee1cf195e20a38f0062f7a7eacd..91d04d67548a3e5216a9ba6838591217dbc931a3 100644 (file)
@@ -8,7 +8,7 @@ namespace Content.Client.Administration.UI.Tabs.PlayerTab;
 [GenerateTypedNameReferences]
 public sealed partial class PlayerTabEntry : ContainerButton
 {
-    public EntityUid? PlayerUid;
+    public NetEntity? PlayerEntity;
 
     public PlayerTabEntry(string username, string character, string identity, string job, string antagonist, StyleBox styleBox, bool connected)
     {
index 60d475a4d28ffef989e1ef3484836afced080200..47b93fdb09a34be12ecad33b667bce5f0cb0f774 100644 (file)
@@ -154,16 +154,16 @@ public sealed class AdminUIController : UIController, IOnStateEntered<GameplaySt
     private void PlayerTabEntryPressed(ButtonEventArgs args)
     {
         if (args.Button is not PlayerTabEntry button
-            || button.PlayerUid == null)
+            || button.PlayerEntity == null)
             return;
 
-        var uid = button.PlayerUid.Value;
+        var entity = button.PlayerEntity.Value;
         var function = args.Event.Function;
 
         if (function == EngineKeyFunctions.UIClick)
-            _conHost.ExecuteCommand($"vv {uid}");
+            _conHost.ExecuteCommand($"vv {entity}");
         else if (function == EngineKeyFunctions.UseSecondary)
-            _verb.OpenVerbMenu(uid, true);
+            _verb.OpenVerbMenu(EntityManager.GetEntity(entity), true);
         else
             return;