ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   ZO_ActionBar help (https://www.esoui.com/forums/showthread.php?t=2436)

justinbarrett 11/15/14 04:10 AM

ZO_ActionBar help
 
I cannot seem to find many commands to manipulate this...I did see a thread here
http://www.esoui.com/forums/showthread.php?t=2268
that was hiding parts, but I want to shift it upwards...just looking for commands to manipulate it in general.
there was not so much on the wiki about this and when I searched ESOUIDocumentationP5 I found nothing.
I would do more research, but since I need to get to my "day job" I though maybe some one would have a faster solution.

merlight 11/15/14 09:38 AM

The control is ZO_ActionBar1. You can shift it up by setting anchors, like any other control:
Lua Code:
  1. ZO_ActionBar1:ClearAnchors()
  2. ZO_ActionBar1:SetAnchor(BOTTOM, nil, BOTTOM, 0, -50)

Take a look at Luminary - Action Bar, it does some tricks with it ;)

justinbarrett 11/15/14 11:37 PM

perfect, where do I find documentation on this stuff?

justinbarrett 11/16/14 04:59 AM

looking at that plugin...I do not see(maybe just inability on my behalf) what events he is usin...looks like he is only using EVENT_PLAYER_ACTIVATED...
my problem is, when ever I close the skills window it reverts to it's old position....since the skills window seems to move it, then move it back.....I have tried multiple events trying to get the right one, but am finding no solution.

merlight 11/16/14 07:22 AM

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)

justinbarrett 11/17/14 07:43 AM

I'll check it, I would my self prefer not to add any hooks....although if something changes later in the api, I may need to rewrite the entire function over every time it changes...but that should not be too much trouble.
ty.

EDIT:
So I went ahead and wrote my own. again, ty.


All times are GMT -6. The time now is 03:02 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI