Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --oUF_Senit 2012--
- --TAGS--
- local numFormat = function(v)
- if v > 1E9 then
- return (floor(v/1E9)).."b"
- elseif v > 1E6 then
- return (floor(v/1E6)).."m"
- elseif v > 1E3 then
- return (floor(v/1E3)).."k"
- else
- return v
- end
- end
- oUF.Tags["senit:hpdefault"] = function(unit)
- if not UnitIsConnected(unit) then
- return ""
- end
- if(UnitIsDead(unit) or UnitIsGhost(unit)) then
- return "|cff9999990|r"
- end
- local min, max = UnitHealth(unit), UnitHealthMax(unit)
- local val = numFormat(min)
- return val.."|cffcccccc|r"
- end
- oUF.TagEvents["senit:hpdefault"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION"
- oUF.Tags["senit:hpperc"] = function(unit)
- if not UnitIsConnected(unit) then
- return "|cff999999Off|r"
- end
- if(UnitIsDead(unit) or UnitIsGhost(unit)) then
- return "|cff999999Dead|r"
- end
- local min, max = UnitHealth(unit), UnitHealthMax(unit)
- local per = 0
- if max > 0 then
- per = floor(min/max*100)
- end
- return per.."%"
- end
- oUF.TagEvents["senit:hpperc"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION"
- oUF.Tags["senit:ppdefault"] = function(unit)
- local min, max = UnitPower(unit), UnitPowerMax(unit)
- local val = numFormat(min)
- return val.."|cffcccccc|r"
- end
- oUF.TagEvents["senit:ppdefault"] = "UNIT_POWER UNIT_MAXPOWER UNIT_CONNECTION"
- oUF.Tags["unitcolor"] = function(unit)
- local color
- if UnitIsPlayer(unit) then
- local _, class = UnitClass(unit)
- color = oUF.colors.class[class]
- end
- return color and ("|cff%02x%02x%02x"):format(color[1] * 255, color[2] * 255, color[3] * 255) or "|cffffffff"
- end
- oUF.TagEvents["unitcolor"] = "UNIT_HEALTH UNIT_CLASSIFICATION UNIT_REACTION"
- -- ComboPoints
- oUF.Tags["myComboPoints"] = function(unit)
- local cp, str
- if(UnitExists'vehicle') then
- cp = GetComboPoints('vehicle', 'target')
- else
- cp = GetComboPoints('player', 'target')
- end
- if (cp == 1) then
- str = string.format("|cff69e80c%d|r",cp)
- elseif cp == 2 then
- str = string.format("|cffb2e80c%d|r",cp)
- elseif cp == 3 then
- str = string.format("|cffffd800%d|r",cp)
- elseif cp == 4 then
- str = string.format("|cffffba00%d|r",cp)
- elseif cp == 5 then
- str = string.format("|cfff10b0b%d|r",cp)
- end
- return str
- end
- oUF.TagEvents["myComboPoints"] = "UNIT_COMBO_POINTS PLAYER_TARGET_CHANGED"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement