Originally Posted by RooR
Ok i figured it out but why cant i change those values. Like i just wanna reverse the health mouseover function on a target (current, and percent on mouseover)
Code:
-- HEALER: deficit, percent on mouseover
-- OTHER: current, percent on mouseover
|
THere's a section called Power, look there.
I've copied the correct part in here and gave you comments on what part does what. Give it a try swapping out, it'll be fine
Lua Code:
local _, type = UnitPowerType(unit)
local color = colors.power[type] or colors.power.FUEL
if cur < max then -- if current power is lower than the max power
if self.__owner.isMouseOver then -- if the unit is mouseover (and current power is lower than max power - nested if)
self.value:SetFormattedText("%s.|cff%02x%02x%02x%s|r", si(UnitPower(unit)), color[1] * 255, color[2] * 255, color[3] * 255, si(UnitPowerMax(unit)))
-- set the text to the current value.max value in colors
elseif type == "MANA" then -- else if the type of power is mana (and current power is lower than max power - nested if)
self.value:SetFormattedText("%d|cff%02x%02x%02x%%|r", floor(UnitPower(unit) / UnitPowerMax(unit) * 100 + 0.5), color[1] * 255, color[2] * 255, color[3] * 255)
-- set the power text to a percentage in colors
elseif cur > 0 then -- else if the current power is more than 0 (and current power is lower than max power - nested if)
self.value:SetFormattedText("%d|cff%02x%02x%02x|r", floor(UnitPower(unit) / UnitPowerMax(unit) * 100 + 0.5), color[1] * 255, color[2] * 255, color[3] * 255)
-- set power text to a percentage in colors
else-- in all other cases - no text for power
self.value:SetText(nil)
end
elseif type == "MANA" and self.__owner.isMouseOver then -- if current power is more than max power and it's mana and the unit is mouseover
self.value:SetFormattedText("|cff%02x%02x%02x%s|r", color[1] * 255, color[2] * 255, color[3] * 255, si(UnitPowerMax(unit)))
-- set power text to max power in colors
else
self.value:SetText(nil) -- set no text for power if none of the above is matched
end