Client

registerContext

fjsf.registerContext(data)

Registers a client-side context menu in the NUI system.


Parameters

  • data table Context configuration object.

    Supported fields:

    • id string Unique context identifier.

    • title string Context title.

    • position string Screen position. Allowed values:

      • right-up

      • right-middle

      • right-down

      • center-up

      • center-middle

      • center-down

      • left-up

      • left-middle

      • left-down

    • size string Context size. Allowed values:

      • small

      • medium

      • large

    • blur boolean Enable background blur.

    • sounds boolean Enable sounds.

    • menu string | nil Parent context ID (back navigation).

    • options table List of context options.

    • onClose function | nil Called when the context is closed.

    • onBack function | nil Called when the back button is pressed.


Context option structure

Each entry in options supports:

  • title string Option title.

  • description string | nil Optional description text.

  • icon string | nil FontAwesome icon class.

  • iconAnim string | nil Optional icon animation class.

  • disabled boolean | nil Disables the option.

  • menu string | nil Opens another registered context.

  • event string | nil Triggers a client event.

  • ServerEvent string | nil Triggers a server event.

  • onSelect function | nil Called when the option is selected.


iconAnim

Visual animation applied to the option icon. Cosmetic only.

Type: string | nil

Allowed values

  • spin

  • spinReverse

  • spinSlow

  • spinPulse

  • pulse

  • beat

  • beatFade

  • fade

  • blinkSoft

  • bounce

  • float

  • orbit

  • shake

  • wiggle

  • tick

  • tiltBreath

  • scan

  • polarFloat

Invalid values are ignored.


Returns

This function does not return anything.


Example


showContext

Displays a registered context menu and enables NUI focus.


Example


closeContext

Closes the active context menu.


Example


setContextOption

Updates a context option dynamically.


Example


getActiveContext


Example

Last updated