Ofcourse, silly me. Fixing the if statements fixed it... sorta. The castbar now gets disabled when reloading UI (EDIT: or rather, it always did and I just didn't know). I'm assuming this has to do with the event calls. Is there another event I should be checking?
Lua Code:
local function cbCheck()
if playerClass == 'DRUID' or playerClass == 'MONK' or playerClass == 'PALADIN' or playerClass == 'SHAMAN' then
if playerClass == 'DRUID' then
if spec == 1 or spec == 4 then
isCaster = true
else
isCaster = false
end
elseif playerClass == 'MONK' then
if spec == 2 then
isCaster = true
else
isCaster = false
end
elseif playerClass == 'PALADIN' then
if spec == 1 then
isCaster = true
else
isCaster = false
end
elseif playerClass == 'SHAMAN' then
if spec == 2 then
isCaster = false
else
isCaster = true
end
end
elseif playerClass == 'DEATHKNIGHT' or playerClass == 'HUNTER' or playerClass == 'ROGUE' or playerClass == 'WARRIOR' then
isCaster = false
elseif playerClass == 'MAGE' or playerClass == 'PRIEST' or playerClass == 'WARLOCK' then
isCaster = true
end
end
I've been trying it out on Monk, Mage, Warlock, and Shaman (caster) so far. Reloading kills it every time.
EDIT: Perhaps it should be noted it's only the player castbar that disappears when reloading. Using a Mage teleport spell did not make it disappear, taking a portal did.