Thread Tools Display Modes
11/15/14, 04:10 AM   #1
justinbarrett
Join Date: Nov 2014
Posts: 25
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.
  Reply With Quote
11/15/14, 09:38 AM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
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
  Reply With Quote
11/15/14, 11:37 PM   #3
justinbarrett
Join Date: Nov 2014
Posts: 25
perfect, where do I find documentation on this stuff?
  Reply With Quote
11/16/14, 04:59 AM   #4
justinbarrett
Join Date: Nov 2014
Posts: 25
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.
  Reply With Quote
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
11/17/14, 07:43 AM   #6
justinbarrett
Join Date: Nov 2014
Posts: 25
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.

Last edited by justinbarrett : 11/17/14 at 07:52 AM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » ZO_ActionBar help


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off