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?
Widget/Gadget interaction
Moderator: Moderators
Re: Widget/Gadget interaction
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')
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
Excellent! *does moar of his mr.Burns impression* 
Now i can have all the ugly non-canon gui additions to Metropolis Spring as widgets

Now i can have all the ugly non-canon gui additions to Metropolis Spring as widgets
