WoWInterface SVN SelfCastSwitch

[/] [trunk/] [SelfCastSwitch/] [selfcastswitch.lua] - Rev 3

Compare with Previous | Blame | View Log

-- Primary Talent Spec is 1 --
-- Secondary Talent Spec is 2 --
-- Which spec (1 or 2) do you want self-cast *on* for? --

local selfCast = 1

-----------------------------------

local f = CreateFrame("Frame")

if GetActiveTalentGroup() == selfCast then
        SetCVar("autoSelfCast", 1, "AUTO_SELF_CAST_TEXT")       --find global string for cvar to fire the event
else
        SetCVar("autoSelfCast", 0, "AUTO_SELF_CAST_TEXT")
end

f:SetScript("OnEvent", function(self, event, spec)
                if spec == selfCast then
                        SetCVar("autoSelfCast", 1, "AUTO_SELF_CAST_TEXT")       --find global string for cvar to fire the event
                else
                        SetCVar("autoSelfCast", 0, "AUTO_SELF_CAST_TEXT")
                end
        end)

f:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")

Compare with Previous | Blame