widgets.watch_function

Observes the return value of an exact zero-argument widget function.

Syntax

ue.widgets.watch_function(widget: UObjectProxy, getter: string, callback: function, options?: table) -> integer?, string?

Parameters

ParameterTypeDescription
widgetUObjectProxyWidget to observe.
getterstringExact zero-argument reflected function.
callbackfunction(value, old_value, widget, id, name)Called when the return value changes.
options.immediateboolean?Deliver current value on the next tick.

Returns

TypeDescription
integerWatch ID.
nil, stringGetter was missing, requires arguments, or has no return value.

Example

local id = assert(ue.widgets.watch_function(
    widget,
    "GetCurrentPage",
    function(value)
        print(value)
    end
))

Notes

  • Requires a persistent session.

On this page