Thank you for that update guide! It already helped alot!
So among other things you changed the method signature of UpdateColor to:
Lua Code:
UpdateColor(self, event, unit, ....)
My Code for AdditionalPower before version 10 was:
Lua Code:
function UNITS:AdditionalPower_UpdateColor(unit)
if (unit) then
local _, powerToken = UNITS:UnitPowerType(unit);
if (powerToken == ADDITIONAL_POWER_BAR_NAME) then
self:Hide();
else
local color = Colors:GetColorForPower(ADDITIONAL_POWER_BAR_NAME);
self:SetStatusBarColor(color.r, color.g, color.b, color.a);
end
end
end
So now it is:
Lua Code:
function UNITS:AdditionalPower_UpdateColor(_, unit)
if (unit) then
local _, powerToken = UNITS:UnitPowerType(unit);
if (powerToken == ADDITIONAL_POWER_BAR_NAME) then
self:Hide();
else
local color = Colors:GetColorForPower(ADDITIONAL_POWER_BAR_NAME);
self:SetStatusBarColor(color.r, color.g, color.b, color.a);
end
end
end
But im getting:
Lua Code:
8x Lybrial_UI\units\elements\powerAdditional.lua:74: attempt to call method 'SetStatusBarColor' (a nil value)
So do I need to do something different?