Appearance
UIManager
Inherits: Class
Methods
AddCancellable
lua
function UIManager:AddCancellable(publisher)Adds a cancellable to be owned by the manager.
Parameters:
| Name | Type | Description |
|---|---|---|
publisher | ReactivePublisher |
AddFrameBuilder
lua
function UIManager:AddFrameBuilder(func)
-> selfAdds a UI frame building function.
Parameters:
| Name | Type | Description |
|---|---|---|
func | fun(state: ReactiveState, ...: unknown, ...): unknown | The function which builds the UI |
Returns:
| Type | Description |
|---|---|
self |
BuildFrame
lua
function UIManager:BuildFrame(...)
-> anyBuilds a frame using a previously-registered builder.
Parameters:
| Name | Type | Description |
|---|---|---|
... | unknown | Additional arguments to pass to the frame builder |
Returns:
| Type | Description |
|---|---|
any |
CallbackToProcessAction
lua
function UIManager:CallbackToProcessAction(action)
-> fun(...)Returns a function which can be used as a callback to process the specified action.
Parameters:
| Name | Type | Description |
|---|---|---|
action | string | The action to be processed |
Returns:
| Type | Description |
|---|---|
fun(...) |
CancelFuture
lua
function UIManager:CancelFuture(stateKey)Cancels a future previously added via :ManageFuture().
Parameters:
| Name | Type | Description |
|---|---|---|
stateKey | K | The 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:
| Name | Type | Description |
|---|---|---|
stateKey | K | The state key to store the future at |
future | Future | The future |
action | string | The action to send |
MirrorStateWithTable
lua
function UIManager:MirrorStateWithTable(key, tbl, tblKey)Mirrors a state key with a given table.
Parameters:
| Name | Type | Description |
|---|---|---|
key | K | The state key |
tbl | TBL | The table to assign to |
tblKey | TBLKey | The key within the table to assign to |
ProcessAction
lua
function UIManager:ProcessAction(action, ...)Processes an action.
Parameters:
| Name | Type | Description |
|---|---|---|
action | string | The action |
... | any | Arguments for the action |
ProcessActionFromPublisher
lua
function UIManager:ProcessActionFromPublisher(action, publisher)Processes an action whenever a value is published.
Parameters:
| Name | Type | Description |
|---|---|---|
action | string | The action to be processed |
publisher | ReactivePublisherSchema | The publisher |
SetStateFromExpression
lua
function UIManager:SetStateFromExpression(key, expression)Sets a state field based on the result of an expression on the state
Parameters:
| Name | Type | Description |
|---|---|---|
key | K | The key to set in the state |
expression | expression<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:
| Name | Type | Description |
|---|---|---|
key | K | The key to set in the state |
publisher | ReactivePublisherSchema<V> | The publisher |
StatePublisherForKey
lua
function UIManager:StatePublisherForKey(key)Gets a publisher for a state key.
Parameters:
| Name | Type | Description |
|---|---|---|
key | string | The state key to get a publisher for. |
SuppressActionLog
lua
function UIManager:SuppressActionLog(action)
-> selfSuppresses logs for a given action
Parameters:
| Name | Type | Description |
|---|---|---|
action | string | boolean | The action or true to suppress all actions |
Returns:
| Type | Description |
|---|---|
self |
_HandleFutureDone
lua
function UIManager:_HandleFutureDone(future)Parameters:
| Name | Type | Description |
|---|---|---|
future | Future |
__init
lua
function UIManager:__init(name, state, actionHandler)Parameters:
| Name | Type | Description |
|---|---|---|
name | `` | |
state | `` | |
actionHandler | `` |
__tostring
lua
function UIManager:__tostring()Functions
Create
lua
function UIManager.Create(name, state, actionHandler)
-> UIManagerCreates a new UI manager object.
Parameters:
| Name | Type | Description |
|---|---|---|
name | string | The name for debugging purposes |
state | T | The state |
actionHandler | UIManagerActionHandler<T> | The action handler |
Returns:
| Type | Description |
|---|---|
UIManager |