So I have an UI addon that creates it's own Paladin Holy Power bar.
Since Only Ret pallies have it, logic would dictate that I should only display it to Ret pallies!!
Here's my problem.
I determine the player's class (this part works)
Code:
cfg.playerclass = select(2,UnitClass("player"))
in the holypower portion of the addon...
Code:
if cfg.playerclass == "PALADIN" and self.cfg.holypower.show then
bars.createHolyPowerBar(self)
end
that part works.
however, when I determine the players spec:
Code:
cfg.playerspec = GetSpecialization()
and try to work that into the Holy Power creation conditions:
Code:
if cfg.playerclass == "PALADIN" and cfg.playerspec == "3" then
bars.createHolyPowerBar(self)
end
then it breaks.
No errors.
Just breaks.
If I type the the following into the games chat:
Code:
/script print(GetSpecialization())
I get a result of 1 for Holy, 2 for Prot, 3 for Ret.
I've tried the code with all 3 specs and with the "cfg.playerspec == "3" condition, the holy power bar will not display in any pally spec.