That little change fixed the disappearing problem.
Now I am running into another problem.
When I repeat the code but instead change it to checking for Warlock Armors, on every other class it displays the Armor Warning.
I know I am missing something simple here, but if this can be solved I can have something ready in a week.
Code:
{ name = "PriestBuff",
-- "PRIEST BUFF TO WATCH"
anchor_to = "CENTER", anchor_from = "CENTER", y_off = -190,
bg_color = "0 0 0", border = "SOLID", border_color = "CLASS",
height = 30, width = 300,
text = { size = 13, color = "CLASS", outline = 1 },
OnUpdate = function(self, u)
self.elapsed = self.elapsed + u
local _, class = UnitClass("player");
local Fortitude = UnitAura("player", "Power Word: Fortitude") or UnitAura("player", "Prayer of Fortitude")
local Spirit = UnitAura("player", "Divine Spirit") or UnitAura("player", "Prayer of Spirit")
local InnerFire = UnitAura("player", "Inner Fire")
if ( class == "PRIEST" ) and Fortitude and Spirit and InnerFire then
self.bg:SetAlpha(0)
self:SetAlpha(0)
else
self.bg:SetAlpha(1)
self:SetAlpha(1)
local missing, active = "|cffffffff", "|cff000000"
self.text:SetFormattedText("%sFortitude %sSpirit %sInner Fire", Fortitude and active or missing, Spirit and active or missing, InnerFire and active or missing)
update = 1
end
end,
},
{ name = "WarlockBuff",
-- "WARLOCK BUFF TO WATCH"
anchor_to = "CENTER", anchor_from = "CENTER", y_off = -190,
bg_color = "0 0 0", border = "SOLID", border_color = "CLASS",
height = 30, width = 250,
text = { size = 13, color = "CLASS", outline = 1 },
OnUpdate = function(self, u)
self.elapsed = self.elapsed + u
local _, class = UnitClass("player");
local Armor = UnitAura("player","Demon Skin") or UnitAura("player","Demon Armor") or UnitAura("player","Fel Armor")
if ( class == "WARLOCK" ) and Armor then
self.bg:SetAlpha(0)
self:SetAlpha(0)
else
self.bg:SetAlpha(1)
self:SetAlpha(1)
local missing, active = "|cffffffff", "|cff000000"
self.text:SetFormattedText("%sArmor", Armor and active or missing)
update = 1
end
end,
},