WoWInterface SVN SelfCastSwitch

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 2 to Rev 3
    Reverse comparison

Rev 2 → Rev 3

trunk/SelfCastSwitch/selfcastswitch.lua
8,29 → 8,18
 
local f = CreateFrame("Frame")
 
local function OnLoad()
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:UnregisterEvent("PLAYER_ENTERING_WORLD")
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
 
local function ToggleSelfCast(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: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("PLAYER_ENTERING_WORLD")
f:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
f:SetScript("OnEvent", function(self, event, ...)
if event == "PLAYER_ENTERING_WORLD" then
OnLoad()
else
ToggleSelfCast(...)
end
end)
\ No newline at end of file +f:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") \ No newline at end of file