WoWInterface SVN SelfCastSwitch

Compare Revisions

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

Rev 3 → Rev 2

SelfCastSwitch/selfcastswitch.lua
8,18 → 8,29
 
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")
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")
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)
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:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
\ No newline at end of file +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