comparison Degaine.lua @ 21:e3f92fae450b

When in combat, disable spells only
author contrebasse
date Fri, 10 Dec 2010 20:05:58 +0100
parents 4da97c12564f
children ddcb7021838b
comparison
equal deleted inserted replaced
20:4da97c12564f 21:e3f92fae450b
7 --------------------------------------------------------------- 7 ---------------------------------------------------------------
8 -- If you stand up by jumping or walking it won't draw your weapon 8 -- If you stand up by jumping or walking it won't draw your weapon
9 -- (it's not possible to know if you were sitting or standing before) 9 -- (it's not possible to know if you were sitting or standing before)
10 10
11 --@debug@ 11 --@debug@
12 local debug = false 12 local debug = true
13 --@end-debug@ 13 --@end-debug@
14 14
15 15
16 --------------------------------------------------------------- 16 ---------------------------------------------------------------
17 -- Globals to local 17 -- Globals to local
18 --------------------------------------------------------------- 18 ---------------------------------------------------------------
19 -- These need to be globals 19 -- These need to be globals :
20 -- GLOBALS: Degaine_ToggleAuto, Degaine_isAuto, BINDING_HEADER_DEGAINE 20 -- GLOBALS: Degaine_ToggleAuto, Degaine_isAuto, BINDING_HEADER_DEGAINE
21 21
22 -- It doesn't matter if they are globals 22 -- It doesn't matter if they are globals, rarely unsed :
23 -- GLOBALS: DEFAULT_CHAT_FRAME 23 -- GLOBALS: DEFAULT_CHAT_FRAME
24 24
25 -- Lua functions 25 -- Lua functions
26 local pairs = pairs; 26 local pairs = pairs;
27 local type = type; 27 local type = type;
205 wasGossipOpened = not isGossipClosed 205 wasGossipOpened = not isGossipClosed
206 isGossipClosed = true 206 isGossipClosed = true
207 t_lastGossipClosed = GetTime() 207 t_lastGossipClosed = GetTime()
208 208
209 elseif event == "PLAYER_REGEN_ENABLED" then 209 elseif event == "PLAYER_REGEN_ENABLED" then
210 desactivate() 210 for k,_ in pairs(events1player) do DegaineFrame:UnregisterEvent(k) end
211 --desactivate()
211 elseif event == "PLAYER_REGEN_DISABLED" then 212 elseif event == "PLAYER_REGEN_DISABLED" then
212 activate() 213 activate()
213 214
214 elseif event == "ADDON_LOADED" and arg1==AddonName then 215 elseif event == "ADDON_LOADED" and arg1==AddonName then
215 if Degaine_isAuto==nil then 216 if Degaine_isAuto==nil then