ok final actions fixes fr this time (#21683)

This commit is contained in:
Nemanja
2023-11-16 00:12:47 -05:00
committed by GitHub
parent ca8d53b4e5
commit de5319737e
4 changed files with 19 additions and 8 deletions

View File

@@ -283,13 +283,15 @@ public sealed class ActionButton : Control, IEntityControl
public void UpdateBackground()
{
if (_action == null)
_controller ??= UserInterfaceManager.GetUIController<ActionUIController>();
if (_action != null ||
_controller.IsDragging && GetPositionInParent() == Parent?.ChildCount - 1)
{
Button.Texture = null;
Button.Texture = _buttonBackgroundTexture;
}
else
{
Button.Texture = _buttonBackgroundTexture;
Button.Texture = null;
}
}
@@ -326,6 +328,8 @@ public sealed class ActionButton : Control, IEntityControl
{
base.FrameUpdate(args);
UpdateBackground();
Cooldown.Visible = _action != null && _action.Cooldown != null;
if (_action == null)
return;
@@ -397,7 +401,7 @@ public sealed class ActionButton : Control, IEntityControl
// it's only depress-able if it's usable, so if we're depressed
// show the depressed style
if (_depressed)
if (_depressed && !_beingHovered)
{
HighlightRect.Visible = false;
SetOnlyStylePseudoClass(ContainerButton.StylePseudoClassPressed);