I use it in the leader discussion screens to pop up the info addict screen. It's a really nice, clean way to reference other lua contexts.
Code:
function OnInfoAddict()
local InfoAddictControl = ContextPtr:LookUpControl("/InGame/InfoAddictScreen");
UIManager:PushModal(InfoAddictControl);
end;
Controls.InfoAddictButton:RegisterCallback( Mouse.eLClick, OnInfoAddict );
When I use the UIAddin method, however, I can't find the InfoAddictScreen context. It's no longer underneath /InGame and I can't find another name for it. In fact, when you're in a lua context in the tuner, you can do:
Code:
ContextPtr:GetID()
ContextPtr:LookUpControl(".."):GetID()
ContextPtr:LookUpControl("../.."):GetID()
... etc, to look figure out the "path" of your context. When I use UIAddin, the path that shows up cannot be directly referenced through LookUpControl(). It's like it goes into noman's land or something. I even tried to create an xml file with "InGame" as the main context, hoping it would append my luacontexts to /InGame, but I still couldn't reference those with an absolute path.
I did notice that InGame.lua adds the LuaContext to a global
g_uiAddins table but I have no idea how to reference that from another context.