Another edit: I got it wrong
Untested, not sure it does what you want:
Lua Code:
local g_tlwHiddenInMainUI = true
-- then in your fragment construction:
fragment:RegisterCallback("StateChange", function(oldState, newState)
if newState == SCENE_FRAGMENT_SHOWING then
tlw:SetHidden(g_tlwHiddenInMainUI)
elseif newState == SCENE_FRAGMENT_HIDDEN then
g_tlwHiddenInMainUI = tlw:IsHidden()
tlw:SetHidden(true)
end
end)