Update dragon devour action icon (#20020)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
DrSmugleaf
2023-09-12 22:05:04 -07:00
committed by GitHub
parent b0e8af46ce
commit f23228bda9
7 changed files with 47 additions and 4 deletions

View File

@@ -961,6 +961,8 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
StopTargeting();
SelectingTargetFor = actionId;
// TODO inform the server
action.Toggled = true;
// override "held-item" overlay
var provider = action.Provider;
@@ -977,6 +979,15 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
handOverlay.IconOverride = _spriteSystem.Frame0(action.Icon);
}
if (_container != null)
{
foreach (var button in _container.GetButtons())
{
if (button.ActionId == actionId)
button.UpdateIcons();
}
}
// TODO: allow world-targets to check valid positions. E.g., maybe:
// - Draw a red/green ghost entity
// - Add a yes/no checkmark where the HandItemOverlay usually is
@@ -1005,10 +1016,27 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
if (SelectingTargetFor == null)
return;
var oldAction = SelectingTargetFor;
if (_actionsSystem != null && _actionsSystem.TryGetActionData(oldAction, out var action))
{
// TODO inform the server
action.Toggled = false;
}
SelectingTargetFor = null;
_targetOutline?.Disable();
_interactionOutline?.SetEnabled(true);
if (_container != null)
{
foreach (var button in _container.GetButtons())
{
if (button.ActionId == oldAction)
button.UpdateIcons();
}
}
if (!_overlays.TryGetOverlay<ShowHandItemOverlay>(out var handOverlay))
return;