Page 1 of 1
Widget/Gadget interaction
Posted: 26 Jan 2009, 18:34
by Anarchid
I know it's possible to send synced-context data from a gadget's sync part to its unsynced code.
But is it possible to somehow tip off a widget script of a change in our synced variables? Will the same thing work as within a gadget?
Re: Widget/Gadget interaction
Posted: 26 Jan 2009, 19:48
by lurker
Did you look in the wiki? I know you didn't look in CA. For shame.
In the unsynced part of your gadget:
if (Script.LuaUI('functionname')) then
Script.LuaUI['functionname'](...)
end
In the widget:
local function functiontogetdata(stuff)
init: widgetHandler:RegisterGlobal('functionname', functiontogetdata)
shutdown: widgetHandler:DeregisterGlobal('functionname')
Re: Widget/Gadget interaction
Posted: 27 Jan 2009, 15:48
by Anarchid
Excellent! *does moar of his mr.Burns impression*
Now i can have all the ugly non-canon gui additions to Metropolis Spring as widgets
