Thread Tools Display Modes
08/02/16, 11:31 PM   #1
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
Hooking Ability Bar FadeIn/Out

Greetings,

There is an option under Settings, Interface to set the Ability Bar to always show, always hide, or "automatic." When set to automatic it will fade in or out depending on combat state, and whether you are targeting a hostile, etc.

What I am trying to do is hook into the fade in/out callback here so I can fire off some functions when this setting shows/hides the action bar.

I have tried various means to do this using fragments, all with limited success. The only thing I managed to get it to do was show or hide when I was on the skills page of the in-game settings.

If anyone knows how to go about this I would be grateful. I am about to pass out from the headache I have thanks to this stupid health condition, but I really want to make this work.
  Reply With Quote
08/03/16, 05:45 AM   #2
Shinni
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 167
The following code will work for the bar at the bottom center of the screen.

Lua Code:
  1. ACTION_BAR_FRAGMENT:RegisterCallback("StateChange", function(oldState, newState)
  2.     --[[ possible states are:
  3.     SCENE_FRAGMENT_SHOWN = "shown"
  4.     SCENE_FRAGMENT_HIDDEN = "hidden"
  5.     SCENE_FRAGMENT_SHOWING = "showing"
  6.     SCENE_FRAGMENT_HIDING = "hiding"
  7.     ]]--
  8. end)

The skill bar in the skill window is a different fragment: SKILLS_ACTION_BAR_FRAGMENT
  Reply With Quote
08/04/16, 01:11 AM   #3
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
Thanks Shinni! That was definitely the one I was looking for. I must have tried every other fragment in the UI and somehow missed this one.

Got it working by first setting up my fragment doing:

Code:
local MY_FRAGMENT = ACTION_BAR_FRAGMENT:New(My_Control)
Then:

Code:
MY_FRAGMENT:RegisterCallback("StateChange", function(oldState, newState)
	if newState == SCENE_FRAGMENT_SHOWN then
		My_Control:SetHidden(false)
	elseif newState == SCENE_FRAGMENT_HIDDEN then
		My_Control:SetHidden(true)
	end
end)
I really appreciate the pointers.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Hooking Ability Bar FadeIn/Out


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