Skip to main content

QuickAccessMenuAction

An abstract class in Root.Township, Alta.QuickAccessActions.

A ScriptableObject for one option in the wrist quick access menu. The menu controller sets it up per player and a bubble shows it, runs it and tracks its state. Client side.

Constructors​

MemberWhat it is
protected QuickAccessMenuAction()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

3 private and internal fields
MemberWhat it is
private string displayNameBacking field for DisplayName, the label shown for the action.
private PlatformFlags isIgnoredOnPlatforms where the action is hidden (IsIgnored), except for developers.
private GameObject prefabIcon prefab made by GetPrefab. A dynamic icon component on it is given this action.

Properties​

MemberWhat it is
string DisplayName { get; }Title shown when the bubble is selected. Falls back to the asset name if empty.
virtual bool HasEffectOnRun { get; }Whether running the action counts as having done something (returned by the bubble's Run). True by default.
virtual bool IgnoreDefaultSfx { get; }When true, the bubble skips the default selection sound.
abstract bool IsActive { get; }Whether the action's toggle is on. Dynamic icons show this state.
virtual bool IsIgnored { get; }True on platforms in the asset's ignore list, unless the player has dev tools. Ignored actions are not shown.
abstract bool IsValid { get; }Whether the action can be used right now. Invalid bubbles show greyed out and do nothing.
virtual float OverrideSelectedScale { get; }Bubble scale when selected, or -1 to use the default.
protected bool IsDev { get; private set; }Protected: whether the player has dev tools, set in InitializeForPlayer.

Events​

MemberWhat it is
event Action<bool> UpdatedActiveRaised by UpdateActive; dynamic icons listen to it.
event Action<bool> UpdatedValidRaised by UpdateValid; the bubble listens to it to grey itself out.

Methods​

MemberWhat it is
virtual void Close()Virtual hook called when the bubble showing this action is released.
GameObject GetPrefab(Transform parent)Spawns the action's icon prefab under a parent and links a dynamic icon to the action if it has one.
virtual void InitializeForPlayer(Player player, bool isDev)Called by the menu controller for the player, with whether dev tools are on.
virtual void MarkSelected(QuickAccessMenuBubble bubble)Virtual hook called when the bubble is selected while valid.
virtual void Open()Virtual hook called when a bubble starts showing this action.
virtual void Run(Controller controller)Virtual: does the action. The bubble calls it only when IsValid.
protected void UpdateActive()Protected: raises UpdatedActive with the current IsActive.
protected void UpdateValid()Protected: raises UpdatedValid with the current IsValid.

Used in​

Members of other types that take, return or hold a QuickAccessMenuAction: