Skip to content

UIManager

Inherits: Class

Methods

AddCancellable

lua
function UIManager:AddCancellable(publisher)

Adds a cancellable to be owned by the manager.

Parameters:

NameTypeDescription
publisherReactivePublisher

AddFrameBuilder

lua
function UIManager:AddFrameBuilder(func)
  -> self

Adds a UI frame building function.

Parameters:

NameTypeDescription
funcfun(state: ReactiveState, ...: unknown, ...): unknownThe function which builds the UI

Returns:

TypeDescription
self

BuildFrame

lua
function UIManager:BuildFrame(...)
  -> any

Builds a frame using a previously-registered builder.

Parameters:

NameTypeDescription
...unknownAdditional arguments to pass to the frame builder

Returns:

TypeDescription
any

CallbackToProcessAction

lua
function UIManager:CallbackToProcessAction(action)
  -> fun(...)

Returns a function which can be used as a callback to process the specified action.

Parameters:

NameTypeDescription
actionstringThe action to be processed

Returns:

TypeDescription
fun(...)

CancelFuture

lua
function UIManager:CancelFuture(stateKey)

Cancels a future previously added via :ManageFuture().

Parameters:

NameTypeDescription
stateKeyKThe state key to use to store the future

ManageFuture

lua
function UIManager:ManageFuture(stateKey, future, action)

Sends an action when a future is done (passing through the value).

Parameters:

NameTypeDescription
stateKeyKThe state key to store the future at
futureFutureThe future
actionstringThe action to send

MirrorStateWithTable

lua
function UIManager:MirrorStateWithTable(key, tbl, tblKey)

Mirrors a state key with a given table.

Parameters:

NameTypeDescription
keyKThe state key
tblTBLThe table to assign to
tblKeyTBLKeyThe key within the table to assign to

ProcessAction

lua
function UIManager:ProcessAction(action, ...)

Processes an action.

Parameters:

NameTypeDescription
actionstringThe action
...anyArguments for the action

ProcessActionFromPublisher

lua
function UIManager:ProcessActionFromPublisher(action, publisher)

Processes an action whenever a value is published.

Parameters:

NameTypeDescription
actionstringThe action to be processed
publisherReactivePublisherSchemaThe publisher

SetStateFromExpression

lua
function UIManager:SetStateFromExpression(key, expression)

Sets a state field based on the result of an expression on the state

Parameters:

NameTypeDescription
keyKThe key to set in the state
expressionexpression<T & ReactiveExprBuiltins, R>The expression to apply to the state

SetStateFromPublisher

lua
function UIManager:SetStateFromPublisher(key, publisher)

Sets up a publisher to assign any published values to the state.

Parameters:

NameTypeDescription
keyKThe key to set in the state
publisherReactivePublisherSchema<V>The publisher

StatePublisherForKey

lua
function UIManager:StatePublisherForKey(key)

Gets a publisher for a state key.

Parameters:

NameTypeDescription
keystringThe state key to get a publisher for.

SuppressActionLog

lua
function UIManager:SuppressActionLog(action)
  -> self

Suppresses logs for a given action

Parameters:

NameTypeDescription
actionstring | booleanThe action or true to suppress all actions

Returns:

TypeDescription
self

_HandleFutureDone

lua
function UIManager:_HandleFutureDone(future)

Parameters:

NameTypeDescription
futureFuture

__init

lua
function UIManager:__init(name, state, actionHandler)

Parameters:

NameTypeDescription
name``
state``
actionHandler``

__tostring

lua
function UIManager:__tostring()

Functions

Create

lua
function UIManager.Create(name, state, actionHandler)
  -> UIManager

Creates a new UI manager object.

Parameters:

NameTypeDescription
namestringThe name for debugging purposes
stateTThe state
actionHandlerUIManagerActionHandler<T>The action handler

Returns:

TypeDescription
UIManager