WoWInterface SVN SelfCastSwitch

Compare Revisions

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

Rev 1 → Rev 2

SelfCastSwitch/selfcastswitch.lua New file
0,0 → 1,36
-- 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")
 
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
 
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("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
SelfCastSwitch/SelfCastSwitch.toc New file
0,0 → 1,7
## Interface: 30200
## Title: SelfCastSwitch
## Notes: Enables/Disables auto self-cast based on your spec
## Author: Seerah
## Version: 1.0
 
selfcastswitch.lua
\ No newline at end of file