Originally Posted by Fathis Ules
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:
local function newSetHiddenLeft(self, hidden, ...) if hidden == false then --do nothing, meaning, SetHidden is disabled return end originalSetHiddenLeft(self, hidden, ...) -- Calls the normal ZO_PlayerAttributeHealthBarLeftGloss.SetHidden end local function newSetHiddenRight(self, hidden, ...) if hidden == false then --do nothing, meaning, SetHidden is disabled return end originalSetHiddenRight (self, hidden, ...) -- Calls the normal ZO_PlayerAttributeHealthBarRightGloss.SetHidden end local originalSetHiddenLeft = ZO_PlayerAttributeHealthBarLeftGloss.SetHidden local originalSetHiddenRight = ZO_PlayerAttributeHealthBarRightGloss.SetHidden ZO_PlayerAttributeHealthBarLeftGloss.SetHidden = newSetHiddenLeft 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