Thread: Stuf + Threat
View Single Post
06-10-11, 04:53 AM   #16
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by Lily.Petal View Post
What I am trying to do is so that If I am any class that uses anything but Rage/RunicPower that when I am at 100% Mana/Energy, the text doesn't show, and I would like it to be a Percent(without the % sign).

Basically:
if power≤99% show if not DK/Bear/Warrior as CurMP%

And basically the opposite if I am a DK/Bear/Warrior
if power≥1% show if DK/Bear/Warrior as CurMP%

Does this help? :<
Ahh. I like doing my Lua Texts with pure Lua. Some of my UI users reported strange power display issues when using Lua Text abbreviations.

Barebones:
Code:
local _, pToken = UnitPowerType(unit)
local pCur, pMax = Power(unit), MaxPower(unit)
if pMax > 0 then
	if pToken == "RAGE" or pToken == "RUNIC_POWER" then
		-- Warrior / Teddy Bear Druid / DK
		if pCur > 0 then
			return "%d", pCur
		end
	else
		-- Everything else
		local pPer = ceil(pCur / pMax)
		if pPer < 100 then
			return "%d", pPer
		end
	end
end
  Reply With Quote