Quantcast STUF Unit frames custom Lua- Is it possible to hide text if the target is casting? - WoWInterface
Thread Tools Display Modes
05-24-19, 05:33 PM   #1
bender1453
A Fallenroot Satyr
Join Date: Mar 2019
Posts: 20
STUF Unit frames custom Luas - Hide level if it's 120 and hide power if it's 0

Changed my mind, the other issue isn't a big problem but these I have to fix.

Last edited by bender1453 : 05-27-19 at 12:30 PM.
  Reply With Quote
05-27-19, 11:46 AM   #2
bender1453
A Fallenroot Satyr
Join Date: Mar 2019
Posts: 20
Title changed as well. I'm using this and it works to some extent for power bars, but it doesn't show the value when it's full and I'd like to remove the class coloring too.

I have no idea how to hide the level text if it's 120, in other words, the cap.

function(unit)
local pCur, pMax, mCur, mMax = UnitPower(unit), UnitPowerMax(unit), UnitPower(unit, 0), UnitPowerMax(unit, 0)
if pMax > 0 then
local pType, pToken = UnitPowerType(unit)
local pColor = PowerBarColor[pType]
if ( (pToken ~= "MANA") and (mMax > 0) ) then -- Druid in Bear/Cat form
local mColor = PowerBarColor[0]
local mPer = ceil((mCur / mMax)*100)
local ShowPower, ShowMana
if ((pToken == "RAGE") and (pCur > 0)) or ((pToken == "ENERGY") and (pCur < pMax)) then
ShowPower = true
end
if mPer < 100 then
ShowMana = true
end
if ShowPower and ShowMana then
return "|cff%02x%02x%02x%s|r %s|cff05cbe5%%|r", pColor.r * 255, pColor.g * 255, pColor.b * 255, pCur, mPer
elseif ShowPower then
return "|cff%02x%02x%02x%s|r", pColor.r * 255, pColor.g * 255, pColor.b * 255, pCur
elseif ShowMana then
return "%s|cff05cbe5%%|r . |cff05cbe5%s|r", mPer, mCur
end

if pToken == "LUNAR_POWER" or pToken == "MAELSTROM" or pToken == "INSANITY" then
if pCur > 0 then
return "|cff%02x%02x%02x%s|r", pColor.r * 255, pColor.g * 255, pColor.b * 255, pCur
end
end
elseif pToken == "RAGE" or pToken == "RUNIC_POWER" or pToken == "FURY" or pToken == "PAIN" then -- Warrior / DK
if pCur > 0 then
return "|cff%02x%02x%02x%s|r", pColor.r * 255, pColor.g * 255, pColor.b * 255, pCur
end
elseif pToken == "MANA" then -- Mage
local pPer = ceil((pCur / pMax)*100)
if pCur < pMax then
return "%s|cff05cbe5%%|r", pPer
end
else -- Everything else
if pCur < pMax then
return "|cff%02x%02x%02x%s|r", pColor.r * 255, pColor.g * 255, pColor.b * 255, pCur
end
end
end
end
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » STUF Unit frames custom Lua- Is it possible to hide text if the target is casting?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off