Thread Tools Display Modes
04/26/14, 04:55 AM   #1
myslex
Join Date: Apr 2014
Posts: 22
Removing 'gloss' from attribute bars?

Helu esoui,

Ever since I discovered theres an alternative way to display the attribute bars by adding these lines:

ZO_PlayerAttributeHealthBarLeftGloss:SetHidden(true)
ZO_PlayerAttributeHealthBarRightGloss:SetHidden(true)
.. I've been inlove, and I cannot imagine going back to using the original 'glossy' version.. However there's a slight issue with this..

It would seem that some function is re-enabling the 'glossyness' when player gain a buff or loses/gain health.. It is then automatically reversed after the 'translation effect'..

Is there a way to completely disable the gloss, and preventing the default functions from 're-enabling' the gloss?

EDIT: also TL;DR
Gloss also has a 'alpha value'. Is it possible to set a 'max alpha value' to say 0 for gloss, like in this example:

ZO_PlayerAttributeHealth.playerAttributeBarObject.timeline:GetAnimation():SetStartAlpha(1.0)
Any help is grately appreciated, thank you in advance!
MYSLxxx

Last edited by myslex : 04/26/14 at 05:10 AM.
  Reply With Quote
04/26/14, 06:15 AM   #2
Fathis Ules
Thief Guild Master
 
Fathis Ules's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
what about hooking it directly

Lua Code:
  1. local function newSetHidden(...)
  2.     --origZO_PlayerAttributeHealthBarLeftGloss(...)
  3. end
  4. local origZO_PlayerAttributeHealthBarLeftGloss.SetHidden = ZO_PlayerAttributeHealthBarLeftGloss.SetHidden
  5. local origZO_PlayerAttributeHealthBarRightGloss.SetHidden = ZO_PlayerAttributeHealthBarLeftGloss.SetHidden
  6. ZO_PlayerAttributeHealthBarLeftGloss.SetHidden = newSetHidden
  7. ZO_PlayerAttributeHealthBarRightGloss.SetHidden = newSetHidden

that's a sample of course but that's how you can change the SetHidden behaviour after you changed it once

Last edited by Fathis Ules : 04/26/14 at 06:17 AM.
  Reply With Quote
04/26/14, 06:52 AM   #3
myslex
Join Date: Apr 2014
Posts: 22
Originally Posted by Fathis Ules View Post
what about hooking it directly

Lua Code:
  1. local function newSetHidden(...)
  2.     --origZO_PlayerAttributeHealthBarLeftGloss(...)
  3. end
  4. local origZO_PlayerAttributeHealthBarLeftGloss.SetHidden = ZO_PlayerAttributeHealthBarLeftGloss.SetHidden
  5. local origZO_PlayerAttributeHealthBarRightGloss.SetHidden = ZO_PlayerAttributeHealthBarLeftGloss.SetHidden
  6. ZO_PlayerAttributeHealthBarLeftGloss.SetHidden = newSetHidden
  7. ZO_PlayerAttributeHealthBarRightGloss.SetHidden = newSetHidden

that's a sample of course but that's how you can change the SetHidden behaviour after you changed it once
I must start this post with saying that I am a mediocre c# programmer, and have never worked with lua before.. and while I :REALLY: appreciate you taking the time to reply in this thread, I have no idea what to make of this proposition you made regarding hooking it directly..

Would it be to much to ask for a 'working' example, since I am too stupid to understand what you're trying to teach me?

/hugs
MYSleX
  Reply With Quote
04/26/14, 08:18 AM   #4
Fathis Ules
Thief Guild Master
 
Fathis Ules's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
If :SetHidden(true) is your solution but something calls again :SetHidden(false) to revert your solution then you need to replace SetHidden by your function to filter out the calls made to SetHidden with false

In the sample I show you how to replace the SetHidden function by yours so you can decide then to pass the original execution to origZO_PlayerAttributeHealthBarLeftGloss to have the result of a normal SetHidden, or to not continue the execution , that's how you can forbid any call made to SetHidden

It is not specific to Lua, it is just called function hooking and is present in all the programming language, the only requirement is overwrite the pointer of the original function by your and to store a pointer of the original function in a local variable before you replace it so you can call later the original function from your.

Lua Code:
  1. local originalSetHiddenLeft = ZO_PlayerAttributeHealthBarLeftGloss.SetHidden
  2. local originalSetHiddenRight = ZO_PlayerAttributeHealthBarRightGloss.SetHidden
  3.  
  4. local function newSetHiddenLeft(self, hidden, ...)
  5.     if hidden == false then
  6.         --do nothing, meaning, SetHidden is disabled
  7.         return
  8.     end
  9.     originalSetHiddenLeft(self, hidden, ...) -- Calls the normal ZO_PlayerAttributeHealthBarLeftGloss.SetHidden
  10. end
  11.  
  12. local function newSetHiddenRight(self, hidden, ...)
  13.     if hidden == false then
  14.         --do nothing, meaning, SetHidden is disabled
  15.         return
  16.     end
  17.     originalSetHiddenRight (self, hidden, ...) -- Calls the normal ZO_PlayerAttributeHealthBarRightGloss.SetHidden
  18. end
  19.  
  20. ZO_PlayerAttributeHealthBarLeftGloss.SetHidden = newSetHiddenLeft
  21. ZO_PlayerAttributeHealthBarRightGloss.SetHidden = newSetHiddenRight

Last edited by Fathis Ules : 04/26/14 at 08:30 AM.
  Reply With Quote
04/26/14, 08:29 AM   #5
myslex
Join Date: Apr 2014
Posts: 22
Originally Posted by Fathis Ules View Post
If :SetHidden(true) is your solution but something calls again :SetHidden(false) to revert your solution then you need to replace SetHidden by your function to filter out the calls made to SetHidden with false

In the sample I show you how to replace the SetHidden function by yours so you can decide then to pass the original execution to origZO_PlayerAttributeHealthBarLeftGloss to have the result of a normal SetHidden, or to not continue the execution , that's how you can forbid any call made to SetHidden

It is not specific to Lua, it is just called function hooking and is present in all the programming language, the only requirement is overwrite the pointer of the original function by your and to store a pointer of the original function in a local variable before you replace it so you can call later the original function from your.

Lua Code:
  1. local function newSetHiddenLeft(self, hidden, ...)
  2.     if hidden == false then
  3.         --do nothing, meaning, SetHidden is disabled
  4.         return
  5.     end
  6.     originalSetHiddenLeft(self, hidden, ...) -- Calls the normal ZO_PlayerAttributeHealthBarLeftGloss.SetHidden
  7. end
  8.  
  9. local function newSetHiddenRight(self, hidden, ...)
  10.     if hidden == false then
  11.         --do nothing, meaning, SetHidden is disabled
  12.         return
  13.     end
  14.     originalSetHiddenRight (self, hidden, ...) -- Calls the normal ZO_PlayerAttributeHealthBarRightGloss.SetHidden
  15. end
  16.  
  17. local originalSetHiddenLeft = ZO_PlayerAttributeHealthBarLeftGloss.SetHidden
  18. local originalSetHiddenRight = ZO_PlayerAttributeHealthBarRightGloss.SetHidden
  19.  
  20. ZO_PlayerAttributeHealthBarLeftGloss.SetHidden = newSetHiddenLeft
  21. ZO_PlayerAttributeHealthBarRightGloss.SetHidden = newSetHiddenRight
This is very impressive, A new way (for me) to tackle the problem. Its kind of like overriding a function, isnt it?

However.. Hiding the 'glossy frame' and then disabling the sethidden function, still results in the 'glossyness' being shown when first aggroing an enemy thinking theres something glossy somewhere else.. Damn it!!

I appreciate you helping me out, really! thank you!
MysLEx
  Reply With Quote
04/26/14, 08:33 AM   #6
myslex
Join Date: Apr 2014
Posts: 22
Originally Posted by myslex View Post
This is very impressive, A new way (for me) to tackle the problem. Its kind of like overriding a function, isnt it?

However.. Hiding the 'glossy frame' and then disabling the sethidden function, still results in the 'glossyness' being shown when first aggroing an enemy thinking theres something glossy somewhere else.. Damn it!!

I appreciate you helping me out, really! thank you!
MysLEx
It seems that the game's default behaviour to fade in the attribute bar on combat begin is messing with the alpha of the 'glossy frame' .. requires further investigation.. Any help is always appreciated. Again.. thanks =)

MsysELx
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » Removing 'gloss' from attribute bars?


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