comparison Degaine.lua @ 23:44e8394d6982

Revert to disable everything in combat, as spells would mess with everything else
author contrebasse
date Fri, 10 Dec 2010 20:37:09 +0100
parents 4da97c12564f
children 3b1123f50be4
comparison
equal deleted inserted replaced
20:4da97c12564f 23:44e8394d6982
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 --for k,_ in pairs(events1player) do DegaineFrame:UnregisterEvent(k) end
210 desactivate() 211 desactivate()
211 elseif event == "PLAYER_REGEN_DISABLED" then 212 elseif event == "PLAYER_REGEN_DISABLED" then
213 --for k,_ in pairs(events1player) do DegaineFrame:RegisterEvent(k) end
212 activate() 214 activate()
213 215
214 elseif event == "ADDON_LOADED" and arg1==AddonName then 216 elseif event == "ADDON_LOADED" and arg1==AddonName then
215 if Degaine_isAuto==nil then 217 if Degaine_isAuto==nil then
216 Degaine_isAuto = true 218 Degaine_isAuto = true
223 end 225 end
224 end 226 end
225 -- Hook when standing up 227 -- Hook when standing up
226 -- (Didn't work, see http://forums.wowace.com/showthread.php?p=310547#post310547) 228 -- (Didn't work, see http://forums.wowace.com/showthread.php?p=310547#post310547)
227 hooksecurefunc("SitStandOrDescendStart",start); 229 hooksecurefunc("SitStandOrDescendStart",start);
230 hooksecurefunc("Dismount",start); -- works with GupPet but not with the default interface...
228 231
229 232
230 --------------------------------------------------------------- 233 ---------------------------------------------------------------
231 -- Commands 234 -- Commands
232 --------------------------------------------------------------- 235 ---------------------------------------------------------------