Browse docs

Radial Menu

Reference for Radial Menu in ambulancejob.

All client exports

Radial Menu

getRadialActions()

  • Purpose: Provides the current list of radial menu actions along with labels, descriptions, and availability metadata.
  • Returns: RadialAction[] where each entry contains id, label, description, icon, available, and optional badge or helper fields.
local actions = exports["sky_ambulancejob"]:getRadialActions()

getRadialAction(actionId)

  • Purpose: Fetches a single action snapshot by actionId.
  • Arguments:
    • actionId (string)
  • Returns: The action snapshot or nil when missing.
local action = exports["sky_ambulancejob"]:getRadialAction("treat_patient")

getRadialActionReport()

  • Purpose: Bundles the action list with a quick lookup map for availability and reason information.
  • Returns: Object with actions and availability, where each key maps to available, disabledReasonKey, and disabledReason.
local report = exports["sky_ambulancejob"]:getRadialActionReport()

isRadialMenuActionAvailable(actionId)

  • Purpose: Tests if a radial menu action is currently enabled without opening the menu.
  • Arguments:
    • actionId (string)
  • Returns: boolean (true when the action exists and is enabled).
local available = exports["sky_ambulancejob"]:isRadialMenuActionAvailable("treat_patient")

triggerRadialMenuAction(actionId)

  • Purpose: Executes the same handler the radial menu would for the given action, without opening the UI.
  • Arguments:
    • actionId (string)
  • Returns:
    • boolean: true when the action was accepted.
    • table?: When the action fails, returns a map with key/fallback for notification text.
local success, err = exports["sky_ambulancejob"]:triggerRadialMenuAction("treat_patient")