Thread Tools Display Modes
04/27/14, 09:49 AM   #1
myslex
Join Date: Apr 2014
Posts: 22
More gloss.. Lets disable it!

My previous thread is here:
http://www.esoui.com/forums/showthread.php?t=1179

I am posting here with an update, and I need your help again:

Extensive testing shows promise using the method user 'biki' suggested.. However!!
When a player uses a 'shielding' or 'power up' ability, extra gloss with the 'protective amount' is added to both the ZO_TargetUnitFramereticleover, and PlayerAttributeHealth frames.. but here is the twist:

.. The functions, or 'variables' are not available till after a player or a target have activated one of these abilities rendering it impossible to 'initialize' a value, say :SetHidden(true), this returns a lua error with 'nil'

functions involved are:

Gloss that is added is this:
ZO_TargetUnitFramereticleoverPowerShieldLeftOverlay
ZO_TargetUnitFramereticleoverPowerShieldLeftOverlayGloss
ZO_TargetUnitFramereticleoverPowerShieldLeftOverlayChunkGloss

ZO_TargetUnitFramereticleoverPowerShieldRightOverlay
ZO_TargetUnitFramereticleoverPowerShieldRightOverlayGloss
ZO_TargetUnitFramereticleoverPowerShieldRightChunkOverlay
Example:
You cannot have this line in the 'OnLoaded' function of your addon:
ZO_TargetUnitFramereticleoverPowerShieldRightOverlayGloss:SetHidden(true)
.. However you can write ingame after a person has used a shielding ability:
/Script ZO_TargetUnitFramereticleoverPowerShieldRightOverlayGloss:SetHidden(true)
So my question is: Is it possible to check if a 'function' or 'variable' is available before executing it??
Say.. Can we check if 'ZO_TargetUnitFramereticleoverPowerShieldRightOverlayGloss:SetHidden(true)' returns error/nil before we actually attempt it?

And before I continue this post, I would like to say that I tried overriding the default 'sethidden' and 'setalpha' methods like user Fathis Ules showed me before, but they are returning nil error aswell..

Sincerely yours,
MSKLEx
  Reply With Quote
04/27/14, 09:59 AM   #2
Ak0
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 20
Code:
if (ZO_TargetUnitFramereticleoverPowerShieldRightOverlay) then
    ZO_TargetUnitFramereticleoverPowerShieldRightOverlayGloss:SetHidden(true)
    ZO_TargetUnitFramereticleoverPowerShieldRightOverlayChunkGloss:SetHidden(true)
end
This checks to see if "ZO_TargetUnitFramereticleoverPowerShieldRightOverlay" exists, and then hides the gloss if it does.

Last edited by Ak0 : 04/27/14 at 10:04 AM.
  Reply With Quote
04/27/14, 11:11 AM   #3
myslex
Join Date: Apr 2014
Posts: 22
Originally Posted by Ak0 View Post
Code:
if (ZO_TargetUnitFramereticleoverPowerShieldRightOverlay) then
    ZO_TargetUnitFramereticleoverPowerShieldRightOverlayGloss:SetHidden(true)
    ZO_TargetUnitFramereticleoverPowerShieldRightOverlayChunkGloss:SetHidden(true)
end
This checks to see if "ZO_TargetUnitFramereticleoverPowerShieldRightOverlay" exists, and then hides the gloss if it does.
Very good! exactly what I wanted! This community rules.

I put the function you presented in the event 'OnReticleChanged' , but if the reticleover has not yet used a shielding ability, and she activates one while im having my mouse hovering over her, the frame wont update untill I move my mouse from her frame and back on her..

Is there anyone that knows if there is a 'power event' for buffs, or in this case 'shields' .. ?

Thank you again!
NMSsLEx
  Reply With Quote
04/27/14, 01:53 PM   #4
myslex
Join Date: Apr 2014
Posts: 22
Originally Posted by myslex View Post
Very good! exactly what I wanted! This community rules.

I put the function you presented in the event 'OnReticleChanged' , but if the reticleover has not yet used a shielding ability, and she activates one while im having my mouse hovering over her, the frame wont update untill I move my mouse from her frame and back on her..

Is there anyone that knows if there is a 'power event' for buffs, or in this case 'shields' .. ?

Thank you again!
NMSsLEx
Updating the thread with my discovery:

I tracked the events and found that there was an event called 'EVENT_UNIT_ATTRIBUTE_VISUAL_ADDED' and bound this event to a custom function that then checked if the unittag was either player or reticleover and then intercepted the 'visual before it was added'. nifty

Again thanks for your awesome help!

HUGS/
MsLXE
  Reply With Quote
04/28/14, 08:15 AM   #5
myslex
Join Date: Apr 2014
Posts: 22
OK!!

UserAk0 helped me out with how to check if a function is available before calling it. Is it possible to do the same, and check if a color is something before we change it, say if

if (ZO_PlayerAttributeHealthPowerShieldLeftOverlay:SetGradientColors(1, 1, 1, 1, 1, 1, 1, 1,) == 1, 1, 1, 1, 1, 1, 1, 1) then
-- something
end
?? Thank you in advance!
MsleLX
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » More gloss.. Lets disable it!


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