View Single Post
04/26/14, 09:12 AM   #9
myslex
Join Date: Apr 2014
Posts: 22
Originally Posted by myslex View Post
That is... excuse the choice of words... ****ing awesome!! I'll try it! thanks man! you're awesome!
I tried it but i think im doing something wrong..

This is declared at the most top of the lua file:

local originalSetAlphaLeft = ZO_PlayerAttributeHealthBarLeftGloss.SetAlpha
local originalSetAlphaRight = ZO_PlayerAttributeHealthBarRightGloss.SetAlpha
These are my two functions declared outside the 'OnAddonLoaded' event:

function newSetAlphaLeft(self, alpha, ...)
if alpha > 0 then
--do nothing, meaning, SetHidden is disabled
return
end
originalSetAlphaLeft(self, alpha, ...) -- Calls the normal ZO_PlayerAttributeHealthBarLeftGloss.SetAlpha
end

function newSetAlphaRight(self, alpha, ...)
if alpha > 0 then
--do nothing, meaning, SetHidden is disabled
return
end
originalSetAlphaRight (self, alpha, ...) -- Calls the normal ZO_PlayerAttributeHealthBarRightGloss.SetAlpha
end
And this is declared 'OnAddonLoaded', aka 'initialized function':

ZO_PlayerAttributeHealthBarLeftGloss.SetAlpha = newSetAlphaLeft
ZO_PlayerAttributeHealthBarRightGloss.SetAlpha = newSetAlphaRight
Please tell me if im doing something wrong, or if this should infact work. I am able to write this after the changes:

ZO_PlayerAttributeHealthBarRightGloss:SetAlpha(1)
Shouldnt work should it?

MSSYLex
  Reply With Quote