Fix right click not showing the context menu in AHelps, players tab and objects tab (#22798)

* Fix right clicks in AHelp window

* Fix player tab right click

* Fix objects tab right click
This commit is contained in:
DrSmugleaf
2023-12-20 22:32:52 -08:00
committed by GitHub
parent 5ee01ce900
commit 0273bbcbf3
5 changed files with 47 additions and 36 deletions

View File

@@ -1,7 +1,6 @@
using Content.Client.Station;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Map.Components;
@@ -15,7 +14,7 @@ public sealed partial class ObjectsTab : Control
private readonly List<ObjectsTabEntry> _objects = new();
private List<ObjectsTabSelection> _selections = new();
public event Action<BaseButton.ButtonEventArgs>? OnEntryPressed;
public event Action<ObjectsTabEntry, GUIBoundKeyEventArgs>? OnEntryKeyBindDown;
public ObjectsTab()
{
@@ -82,7 +81,7 @@ public sealed partial class ObjectsTab : Control
var ctrl = new ObjectsTabEntry(name, entity);
_objects.Add(ctrl);
ObjectList.AddChild(ctrl);
ctrl.OnPressed += args => OnEntryPressed?.Invoke(args);
ctrl.OnKeyBindDown += args => OnEntryKeyBindDown?.Invoke(ctrl, args);
}
}

View File

@@ -28,7 +28,7 @@ namespace Content.Client.Administration.UI.Tabs.PlayerTab
private bool _ascending = true;
private bool _showDisconnected;
public event Action<ButtonEventArgs>? OnEntryPressed;
public event Action<PlayerTabEntry, GUIBoundKeyEventArgs>? OnEntryKeyBindDown;
public PlayerTab()
{
@@ -123,7 +123,7 @@ namespace Content.Client.Administration.UI.Tabs.PlayerTab
player.Connected,
player.PlaytimeString);
entry.PlayerEntity = player.NetEntity;
entry.OnPressed += args => OnEntryPressed?.Invoke(args);
entry.OnKeyBindDown += args => OnEntryKeyBindDown?.Invoke(entry, args);
entry.ToolTip = Loc.GetString("player-tab-entry-tooltip");
PlayerList.AddChild(entry);