OPX//77
opx_infinitygarages

Client

Last updated on

The garages contract on the client — the points this client knows and the key's action.

local garages = OPX.Api.Get('garages')

From client code inside opx_infinity.

Bring

Same as pressing the key on the point underfoot: opens the list at a menu point, sends a request at an entry point. The real answer arrives later on opx:on:garages:decision.

garages.Bring(origin)

Parameters

  • origin?: string
    • Copied into the verdict's source, to tell callers apart.

Returns

  • Result — value: the local verdict
Example
AddEventHandler('opx:on:garages:decision', function(v)
    if v.source == 'myjob' and v.ok then print(v.action, v.plate) end
end)
garages.Bring('myjob')

Nearest

The point the player stands on.

garages.Nearest()

Returns

  • Result — value { key, label, kind }; garages.noSuchSpot when not on a point

Spots

Points this client was sent (its own bucket only).

garages.Spots()

Returns

  • Result — value { spots }

Garages

Garages derived from the points.

garages.Garages()

Returns

  • Result — value { garages }, garages[key] = { key, label, kind }

State

Diagnostic: counts, nearest point, its role, whether the row is shown, open list, key label.

garages.State()

Returns

  • Result

On this page