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:
@@ -23,6 +23,7 @@ public sealed class ListContainer : Control
|
||||
public bool Toggle { get; set; }
|
||||
public Action<ListData, ListContainerButton>? GenerateItem;
|
||||
public Action<BaseButton.ButtonEventArgs?, ListData?>? ItemPressed;
|
||||
public Action<GUIBoundKeyEventArgs, ListData?>? ItemKeyBindDown;
|
||||
public IReadOnlyList<ListData> Data => _data;
|
||||
|
||||
private const int DefaultSeparation = 3;
|
||||
@@ -135,6 +136,11 @@ public sealed class ListContainer : Control
|
||||
ItemPressed?.Invoke(args, button.Data);
|
||||
}
|
||||
|
||||
private void OnItemKeyBindDown(ListContainerButton button, GUIBoundKeyEventArgs args)
|
||||
{
|
||||
ItemKeyBindDown?.Invoke(args, button.Data);
|
||||
}
|
||||
|
||||
[Pure]
|
||||
private Vector2 GetScrollValue()
|
||||
{
|
||||
@@ -256,6 +262,7 @@ public sealed class ListContainer : Control
|
||||
{
|
||||
button = new ListContainerButton(data);
|
||||
button.OnPressed += OnItemPressed;
|
||||
button.OnKeyBindDown += args => OnItemKeyBindDown(button, args);
|
||||
button.ToggleMode = Toggle;
|
||||
button.Group = _buttonGroup;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user