// // Generated by UI Creator. Do not edit; your changes are lost on the next export. // using System; using Uigenx.Actions; namespace Game.UI.Generated { /// Actions the Hud screen raises, and typed helpers for listening to them. public static class HudActions { public const string Pause = "hud.pause"; public const string UseItem = "hud.use-item"; public const string InspectItem = "hud.inspect-item"; /// Payload key `slot` on use-item and inspect-item, declared as `int` in the studio. public const string SlotKey = "slot"; public static IDisposable OnPause(Action handler) => UgxActionBus.Subscribe(Pause, _ => handler()); public static IDisposable OnUseItem(Action handler) => UgxActionBus.Subscribe(UseItem, action => handler(action.Payload.GetInt(SlotKey))); public static IDisposable OnInspectItem(Action handler) => UgxActionBus.Subscribe(InspectItem, action => handler(action.Payload.GetInt(SlotKey))); /// Raises use-item from game code, for example from a gamepad shortcut. public static void EmitUseItem(int slot) => UgxActionBus.Emit(UseItem, UgxActionPayload.Of(SlotKey, slot)); } }