ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   More gloss.. Lets disable it! (https://www.esoui.com/forums/showthread.php?t=1206)

myslex 04/27/14 09:49 AM

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:
Quote:

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:
Quote:

ZO_TargetUnitFramereticleoverPowerShieldRightOverlayGloss:SetHidden(true)
.. However you can write ingame after a person has used a shielding ability:
Quote:

/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

Ak0 04/27/14 09:59 AM

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. :)

myslex 04/27/14 11:11 AM

Quote:

Originally Posted by Ak0 (Post 6104)
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

myslex 04/27/14 01:53 PM

Quote:

Originally Posted by myslex (Post 6115)
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

myslex 04/28/14 08:15 AM

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

Quote:

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


All times are GMT -6. The time now is 06:12 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI