View Single Post
08/18/14, 06:10 AM   #4
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
If you add scene fragment to the scene, it means that fragment should be visible when scene is shown. So, I'd say it's working as intended.

But I think you want to set conditional to your fragment:
Lua Code:
  1. local tlw = WINDOW_MANAGER:CreateTopLevelWindow("tlw")
  2. local hidden = true
  3.  
  4. zo_callLater(function() addon.AddUiFragment(tlw) end,4000)
  5.  
  6. function addon.AddUiFragment(control)
  7.     local fragment = ZO_SimpleSceneFragment:New(tlw)
  8.     fragment:SetConditional(function() return hidden end)
  9.     HUD_SCENE:AddFragment(fragment)
  10.     HUD_UI_SCENE:AddFragment(fragment)
  11. end

Another method would be adding or removing scene fragment.
  Reply With Quote