vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | WandCancel = AceAddon:new({ |
2 | name = "WandCancel", |
||
3 | description = "Cancels wand casting upon trying to cast a spell.", |
||
4 | version = "1.4", |
||
5 | releaseDate = "10-02-2005", |
||
6 | aceCompatible = 102, |
||
7 | author = "Thalinon", |
||
8 | email = "bunjiro@gmail.com", |
||
9 | category = "combat", |
||
10 | db = AceDatabase:new("WandCancelDB"), |
||
11 | defaults = DEFAULT_OPTIONS, |
||
12 | cmd = AceChatCmd:new(WANDCANCEL.COMMANDS, WANDCANCEL.CMD_OPTIONS) |
||
13 | }) |
||
14 | |||
15 | function WandCancel:Initialize() |
||
16 | self.GetOpt = function(var) return self.db:get(self.profilePath,var) end |
||
17 | self.SetOpt = function(var,val) self.db:set(self.profilePath,var,val) end |
||
18 | self.TogOpt = function(var) return self.db:toggle(self.profilePath,var) end |
||
19 | end |
||
20 | |||
21 | function WandCancel:Enable() |
||
22 | self:RegisterEvent("START_AUTOREPEAT_SPELL") |
||
23 | self:RegisterEvent("STOP_AUTOREPEAT_SPELL") |
||
24 | end |
||
25 | |||
26 | WandCancel:RegisterForLoad() |
||
27 | |||
28 | function WandCancel:START_AUTOREPEAT_SPELL() |
||
29 | self:RegisterEvent("UI_ERROR_MESSAGE","CancelWand") |
||
30 | end |
||
31 | |||
32 | function WandCancel:STOP_AUTOREPEAT_SPELL() |
||
33 | self:UnregisterEvent("UI_ERROR_MESSAGE") |
||
34 | end |
||
35 | |||
36 | function WandCancel:CancelWand() |
||
37 | if(string.find(arg1, "Spell is not ready yet.") or string.find(arg1, "Item is not ready yet.")) then |
||
38 | SpellStopCasting() |
||
39 | UIErrorsFrame:AddMessage("Wand casting has been cancelled!", 1.0, 0.1, 0.1, 1.0, 1) |
||
40 | end |
||
41 | end |