Improve vv /c/enthover and add keybind (#20127)

This commit is contained in:
Leon Friedrich
2023-09-16 16:09:51 +12:00
committed by GitHub
parent 8e351bbf68
commit 411fc8e27b
11 changed files with 74 additions and 27 deletions

View File

@@ -19,7 +19,7 @@ using Direction = Robust.Shared.Maths.Direction;
namespace Content.Client.UserInterface.Systems.Actions.Controls;
public sealed class ActionButton : Control
public sealed class ActionButton : Control, IEntityControl
{
private IEntityManager? _entities;
@@ -197,7 +197,7 @@ public sealed class ActionButton : Control
private void UpdateItemIcon()
{
if (!Actions.TryGetActionData(ActionId, out var action) ||
action is not { EntityIcon: { } entity } ||
action is not {EntityIcon: { } entity} ||
!Entities.HasComponent<SpriteComponent>(entity))
{
_bigItemSpriteView.Visible = false;
@@ -344,7 +344,7 @@ public sealed class ActionButton : Control
public void Depress(GUIBoundKeyEventArgs args, bool depress)
{
// action can still be toggled if it's allowed to stay selected
if (!Actions.TryGetActionData(ActionId, out var action) || action is not { Enabled: true })
if (!Actions.TryGetActionData(ActionId, out var action) || action is not {Enabled: true})
return;
if (_depressed && !depress)
@@ -401,4 +401,6 @@ public sealed class ActionButton : Control
SetOnlyStylePseudoClass(ContainerButton.StylePseudoClassNormal);
}
EntityUid? IEntityControl.UiEntity => ActionId;
}