Thread Tools Display Modes
04/05/14, 06:18 PM   #1
Kith
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 49
Question About RegisterForUpdate

I'm working on a mod to 'enhance' the stock UI rather than replace it for things like attribute bars and one of the options I want to offer is to set a minimum-fade (alpha) level for the bars out of combat. Now i'm aware of this function:

EVENT_MANAGER:UnregisterForUpdate("ZO_PlayerAttributeMagickaFadeUpdate")

That will stop the bars fading entirely, but then requires that I need to hook a couple of events to manually change alpha levels as I go, and also the method used by 'improvedattributebars' that runs an OnUpdate handler to constantly force the alpha back up to the desired level.

Is there anyway to find out how the FadeUpdate function is working and modify it to set a minimum alpha level, as in, does anybody have a full access to the current UI and would be willing to nudge over a snippet so I could mess with such? I'd like to maintain the current fading in/out that the UI has just without it fading entirely and I don't really want to use OnUpdate for this.
  Reply With Quote
04/05/14, 08:17 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
It looks like this feature is already in this addon: http://www.esoui.com/downloads/info7...ibuteBars.html

/edit: you can see how they managed to do it
  Reply With Quote
04/05/14, 10:54 PM   #3
Kith
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 49
Originally Posted by Seerah View Post
It looks like this feature is already in this addon: http://www.esoui.com/downloads/info7...ibuteBars.html

/edit: you can see how they managed to do it
Aye, thats the mod I saw using the OnUpdate method to prevent the fade out. Its why I was wondering if there was a way to possibly do so without using such. Its not a huge amount of work in an OnUpdate handler for it, but I still try to avoid the handler when I possibly can (though my current concept is using that method until I can find another one).
  Reply With Quote
04/10/14, 10:38 AM   #4
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Kith View Post
I'm working on a mod to 'enhance' the stock UI rather than replace it for things like attribute bars and one of the options I want to offer is to set a minimum-fade (alpha) level for the bars out of combat. Now i'm aware of this function:

EVENT_MANAGER:UnregisterForUpdate("ZO_PlayerAttributeMagickaFadeUpdate")

That will stop the bars fading entirely, but then requires that I need to hook a couple of events to manually change alpha levels as I go, and also the method used by 'improvedattributebars' that runs an OnUpdate handler to constantly force the alpha back up to the desired level.

Is there anyway to find out how the FadeUpdate function is working and modify it to set a minimum alpha level, as in, does anybody have a full access to the current UI and would be willing to nudge over a snippet so I could mess with such? I'd like to maintain the current fading in/out that the UI has just without it fading entirely and I don't really want to use OnUpdate for this.
As far as I know, fading is done using animations, so you will need to try to do something with:
ZO_PlayerAttributeMagickaBar.timeline

Pawkette's "LibAnimation-1.0" could help.
  Reply With Quote
04/10/14, 08:19 PM   #5
Kith
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 49
Finally figured this one out, and it was simple enough i'm annoyed at myself for not looking before. Each of the attributes does use animations to fade as Garkin said, so I looked into the metadata in ZGoo, found the timeline and was as simple as setting the alpha for the animations.
Lua Code:
  1. ZO_PlayerAttributeHealth.playerAttributeBarObject.timeline:GetAnimation():SetStartAlpha(minAlpha)
StartAlpha for the player attributes is its 'resting' state, so this is the minimum it'll fade to, EndAlpha is its active state (ie, during combat). Have been testing this in my mod while I finish polishing it up and its working fine so far, and got rid of wibbly feeling about having to use OnUpdate to force alpha.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Question About RegisterForUpdate


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