View Single Post
11/16/14, 07:22 AM   #5
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Found it, the bar is re-anchored every time the skills window is shown/hidden:

Lua Code:
  1. -- ingame/scenes/ingamefragments.lua
  2.  
  3. function ZO_SkillsActionBarFragment:Show()
  4.     ZO_ActionBar1:ClearAnchors()
  5.     ZO_ActionBar1:SetAnchor(BOTTOM, ZO_Skills, BOTTOM, -40, 40)
  6.  
  7.     ActionButton9:SetHidden(true)
  8.     ZO_ActionBar1KeybindBG:SetHidden(true)
  9.  
  10.     ZO_FadeSceneFragment.Show(self)
  11. end
  12.  
  13. function ZO_SkillsActionBarFragment:OnStateChange(oldState, newState)
  14.     if newState == SCENE_FRAGMENT_HIDDEN then
  15.         ZO_ActionBar1:ClearAnchors()
  16.         ZO_ActionBar1:SetAnchor(BOTTOM, GuiRoot, BOTTOM, 0, 0)
  17.         ActionButton9:SetHidden(false)
  18.         ZO_ActionBar1KeybindBG:SetHidden(false)
  19.     end
  20. end

You could either post-hook these two functions on SKILLS_ACTION_BAR_FRAGMENT, or replace that fragment with your own modified version. Haven't tested it, but looks a bit cleaner than hooking functions, so I hope it will work:

Lua Code:
  1. local customSkillsActionBarFragment = ZO_SkillsActionBarFragment:New()
  2.  
  3. function customSkillsActionBarFragment:OnShown()
  4.     -- call original (class) method
  5.     ZO_SkillsActionBarFragment.OnShown(self)
  6.     -- now do your stuff
  7.     ...
  8. end
  9.  
  10. function customSkillsActionBarFragment:OnStateChange(oldState, newState)
  11.     -- call original (class) method
  12.     ZO_SkillsActionBarFragment.OnStateChange(self, oldState, newState)
  13.     -- now do your stuff
  14.     ...
  15. end
  16.  
  17. local skillsScene = SCENE_MANAGER:GetScene("skills")
  18. skillsScene:RemoveFragment(SKILLS_ACTION_BAR_FRAGMENT)
  19. skillsScene:AddFragment(customSkillsActionBarFragment)

Last edited by merlight : 11/16/14 at 07:31 AM.
  Reply With Quote