View Single Post
12-10-13, 09:03 PM   #9
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
Originally Posted by RooR View Post
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:
  1. local _, type = UnitPowerType(unit)
  2.     local color = colors.power[type] or colors.power.FUEL
  3.     if cur < max then -- if current power is lower than the max power
  4.         if self.__owner.isMouseOver then -- if the unit is mouseover (and current power is lower than max power - nested if)
  5.             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)))
  6.             -- set the text to the current value.max value in colors
  7.         elseif type == "MANA" then -- else if the type of power is mana (and current power is lower than max power - nested if)
  8.             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)
  9.             -- set the power text to a percentage in colors
  10.         elseif cur > 0 then -- else if the current power is more than 0 (and current power is lower than max power - nested if)
  11.             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)
  12.             -- set power text to a percentage in colors
  13.         else-- in all other cases - no text for power
  14.             self.value:SetText(nil)
  15.         end
  16.     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
  17.         self.value:SetFormattedText("|cff%02x%02x%02x%s|r", color[1] * 255, color[2] * 255, color[3] * 255, si(UnitPowerMax(unit)))
  18.         -- set power text to max power in colors
  19.     else
  20.         self.value:SetText(nil) -- set no text for power if none of the above is matched
  21.     end
  Reply With Quote