StopTargeting();
SelectingTargetFor = actionId;
+ // TODO inform the server
+ action.Toggled = true;
// override "held-item" overlay
var provider = action.Provider;
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
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;
noSpawn: true
components:
- type: EntityTargetAction
- icon: Interface/Actions/devour.png
+ icon: { sprite : Interface/Actions/devour.rsi, state: icon }
+ iconOn: { sprite : Interface/Actions/devour.rsi, state: icon-on }
event: !type:DevourActionEvent