vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 --[[
2 Guild Event Manager by Kiki of European Cho'gall (Alliance)
3 Debug module
4 ]]
5  
6 GEM_DEBUG_GLOBAL = 1; -- Blanc
7 GEM_DEBUG_PROTOCOL = 2; -- Jaune foncé
8 GEM_DEBUG_CHANNEL = 3; -- Bleu clair
9 GEM_DEBUG_EVENTS = 4; -- Vert foncé
10 GEM_DEBUG_COMMANDS = 5; -- Orange clair
11 GEM_DEBUG_SUBSCRIBERS = 6; -- Violet foncé
12 GEM_DEBUG_GUI = 7; -- Cyan clair
13 GEM_DEBUG_QUEUES = 8; -- Cyan foncé
14 GEM_DEBUG_WARNING = 9; -- Rouge
15  
16 local _GEM_DBG_ColorCodes = {{1,1,1},{0.5,0.5,0},{0,0,1.0},{0,0.4,0},{1,0.5,0},{1,0,1},{0,0.6,0.9},{0,0.4,0.5},{1,0.1,0.1}};
17  
18 function GEM_DBG_SetDebugMode(mode,wipedata)
19 if(mode == 1 or mode == 2)
20 then
21 GEM_Events.debug = mode;
22 GEMMainFrameTab5:Show();
23 if(mode == 2 and wipedata)
24 then
25 GEM_Events.debug_log = {};
26 end
27 else
28 if(GEMDebugFrame:IsVisible())
29 then
30 GEMMain_SelectTab(1);
31 end
32 GEMMainFrameTab5:Hide();
33 GEM_Events.debug = 0;
34 end
35 end
36  
37 function GEM_ChatDebug(dbg_type,str)
38 if(GEM_Events.debug and GEM_Events.debug >= 1)
39 then
40 local tab = date("*t",tim);
41 local hour_str = tab.hour;
42 local min_str = tab.min;
43 local sec_str = tab.sec;
44  
45 if(string.len(hour_str) == 1)
46 then
47 hour_str = "0"..hour_str;
48 end
49 if(string.len(min_str) == 1)
50 then
51 min_str = "0"..min_str;
52 end
53 if(string.len(sec_str) == 1)
54 then
55 sec_str = "0"..sec_str;
56 end
57 local time_str = "["..hour_str..":"..min_str..":"..sec_str.."] ";
58 GEMDebug_Log:AddMessage(time_str..str,_GEM_DBG_ColorCodes[dbg_type][1],_GEM_DBG_ColorCodes[dbg_type][2],_GEM_DBG_ColorCodes[dbg_type][3]);
59 if(GEM_Events.debug == 2)
60 then
61 table.insert(GEM_Events.debug_log,time_str..str);
62 end
63 end
64 end
65  
66 function GEM_ChatWarning(str)
67 if(DEFAULT_CHAT_FRAME)
68 then
69 DEFAULT_CHAT_FRAME:AddMessage("GuildEventManager WARNING (please inform Kiki) : "..str, 1.0, 0, 0);
70 end
71 GEM_ChatDebug(GEM_DEBUG_WARNING,str);
72 end
73  
74 function GEM_ChatPrint(str)
75 if(DEFAULT_CHAT_FRAME)
76 then
77 DEFAULT_CHAT_FRAME:AddMessage("GuildEventManager : "..str, 0.9, 0.8, 0.10);
78 end
79 end
80  
81 function GEM_ChatMsg(str)
82 if(DEFAULT_CHAT_FRAME)
83 then
84 DEFAULT_CHAT_FRAME:AddMessage(str, 0.9, 0.7, 0.10);
85 end
86 end
87  
88  
89 --[[
90 Simulate JOIN channel :
91 -> /script arg9="kikichan2";arg2="Lenor";event="CHAT_MSG_CHANNEL_JOIN";GEM_OnEvent();
92 Simulate LEAVE channel :
93 -> /script arg9="kikichan2";arg2="Lenor";event="CHAT_MSG_CHANNEL_LEAVE";GEM_OnEvent();
94  
95  
96 ]]
97