Originally Posted by
Buttonmasher
I honestly have no idea how to do that...
I've been using this script myself to display a kgpanel on my priest only when he's in disc-spec:
Code:
self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
self:RegisterEvent("PLAYER_LOGIN")
local class = UnitClass("player")
local specId = GetSpecialization()
if class == "Priest" then
if specId == 1 then
self:Show()
else
self:Hide()
end
else
self:Hide()
end
Both in OnLoad and OnEvent - I built this myself so it may not be efficient or "good" at all but it does what I want it to do.
If you take a look at the suggestions above, you may just as well improve upon mine if you want to.
Edit: incorporated the previous suggestions into my script, should look like that:
Code:
self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
self:RegisterEvent("PLAYER_LOGIN")
if UnitClass("player") == "Priest" then
if select(2, GetSpecializationInfo(GetSpecialization())) == "Discipline" then
self:Show()
else
self:Hide()
end
else
self:Hide()
end
Just in case and I haven't tested it if it's really an issue (but it would make sense to be one), while the class check may be redundant on certain classes such as rogue (he won't be running around in holy spec), holy as an example can be present on multiple classes so I thought it would make sense to check for class as well.