View Single Post
05/12/14, 01:58 AM   #12
LoPony
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 10
Originally Posted by Aicam View Post
Lua Code:
  1. local fragment = ZO_FadeSceneFragment:New( yourControl )
  2.  
  3. SCENE_MANAGER:GetScene('hud'):AddFragment( fragment )
  4. SCENE_MANAGER:GetScene('hudui'):AddFragment( fragment )

This adds yourControl to the HUD and the UI engine does all the work showing and hiding it when its appropriate. The downsite is you can't remove this show/hide behaviour without a reload of the UI, unless you want to hack into the scene by removing the fragment by force and toggling the scene twice.
Imo triggering an reload when changing something like this is acceptable.
Any possibility to have some control about this?
Currently it hides the UI if you use siege weapons, I would like to remove that behavior.

edit: well I just found it. This does the job
Code:
SCENE_MANAGER.scenes.siegeBar:RegisterCallback( 'StateChange', function( oldState, newState ) 
  if( newState == 'showing' ) then
    myControl:SetHidden( false )
  end
end )

Last edited by LoPony : 05/12/14 at 02:13 AM.
  Reply With Quote