public
Description: WoW addon - Track down those needy and greedy party members
Homepage: http://www.tekkub.net
Clone URL: git://github.com/tekkub/greedbeacon.git
Click here to lend your support to: greedbeacon and make a donation at www.pledgie.com !
Flesh out a bunch of debug messages, might help with localization or some 
shit.
tekkub (author)
Sun Jun 01 14:08:33 -0700 2008
commit  f112aca69a6b396c234fe90fd8e740dacbc8a1e5
tree    6ff11cf458c4c28c0ffa2ccc34a9f871cfb3f929
parent  71bad1aa9f61f7eed4a250599df9e713ed49ab3f
...
4
5
6
 
 
 
 
 
7
8
9
10
 
 
 
 
 
 
11
12
13
14
15
 
 
 
 
16
17
18
19
 
 
 
 
20
21
22
...
25
26
27
 
28
29
30
...
37
38
39
 
40
41
42
...
45
46
47
 
48
49
50
...
56
57
58
 
59
60
61
62
63
64
 
65
66
67
68
69
70
71
72
73
74
 
 
 
 
75
76
77
...
4
5
6
7
8
9
10
11
12
13
14
 
15
16
17
18
19
20
21
22
23
24
 
25
26
27
28
29
30
31
 
32
33
34
35
36
37
38
...
41
42
43
44
45
46
47
...
54
55
56
57
58
59
60
...
63
64
65
66
67
68
69
...
75
76
77
78
79
80
81
82
83
 
84
85
86
87
88
89
90
 
 
 
 
91
92
93
94
95
96
97
0
@@ -4,19 +4,35 @@ local colorneed, colorgreed = "|cffff0000", "|cffffff00"
0
 local coloredwords = {Greed = colorgreed.."Greed", Need = colorneed.."Need"}
0
 local rolls = {}
0
 
0
+local function Print(...) ChatFrame1:AddMessage(string.join(" ", "|cFF33FF99GreedBeacon|r:", ...)) end
0
+
0
+local debugf = tekDebug and tekDebug:GetFrame("GreedBeacon")
0
+local function Debug(...) if debugf then debugf:AddMessage(string.join(", ", ...)) end end
0
+
0
 
0
 local chatframes = {[ChatFrame1] = false, [ChatFrame2] = false, [ChatFrame3] = false, [ChatFrame4] = false, [ChatFrame5] = false, [ChatFrame6] = false, [ChatFrame7] = false}
0
 for frame in pairs(chatframes) do
0
- for i,v in pairs(frame.messageTypeList) do if v == "LOOT" then chatframes[frame] = true end end
0
+ for i,v in pairs(frame.messageTypeList) do
0
+ if v == "LOOT" then
0
+ chatframes[frame] = true
0
+ Debug("Initializing", frame:GetName())
0
+ end
0
+ end
0
 end
0
 
0
 local origadd, origrem = ChatFrame_AddMessageGroup, ChatFrame_RemoveMessageGroup
0
 ChatFrame_AddMessageGroup = function(frame, channel, ...)
0
- if channel == "LOOT" then chatframes[frame] = true end
0
+ if channel == "LOOT" then
0
+ chatframes[frame] = true
0
+ Debug("ChatFrame_AddMessageGroup", frame:GetName())
0
+ end
0
   return origadd(frame, channel, ...)
0
 end
0
 ChatFrame_RemoveMessageGroup = function(frame, channel, ...)
0
- if channel == "LOOT" then chatframes[frame] = false end
0
+ if channel == "LOOT" then
0
+ chatframes[frame] = false
0
+ Debug("ChatFrame_RemoveMessageGroup", frame:GetName())
0
+ end
0
   return origrem(frame, channel, ...)
0
 end
0
 
0
@@ -25,6 +41,7 @@ local function FindRoll(link, player, hasselected)
0
   for i,roll in ipairs(rolls) do
0
     if roll._link == link and not roll._winner and (not roll[player] or hasselected) then return roll end
0
   end
0
+ Debug("New roll started", link)
0
   local newroll = {_link = link}
0
   table.insert(rolls, newroll)
0
   return newroll
0
@@ -37,6 +54,7 @@ f:SetScript("OnEvent", function(self, event, msg)
0
   local rolltype, rollval, link, player = msg:match("(.+) Roll . (%d+) for (.+) by (.+)")
0
   if player then
0
     local roll = FindRoll(link, player, true)
0
+ Debug("Roll detected", player, rolltype, rollval, link)
0
     roll[player] = (rolltype == "Need" and colorneed or colorgreed)..rollval
0
     roll._type = rolltype
0
     return
0
@@ -45,6 +63,7 @@ f:SetScript("OnEvent", function(self, event, msg)
0
   local player, selection, link = msg:match("(.*) has?v?e? selected (.+) for: (.+)")
0
   if player then
0
     player = player == "You" and UnitName("player") or player
0
+ Debug("Selection detected", player, selection, link)
0
     FindRoll(link, player)[player] = coloredwords[selection]
0
     return
0
   end
0
@@ -56,22 +75,23 @@ f:SetScript("OnEvent", function(self, event, msg)
0
       if roll._link == link and roll[player] and not roll._printed then
0
         roll._printed = true
0
         roll._winner = player
0
+ Debug("Roll completed", roll._type or "nil", i, player, link)
0
         local msg = string.format("%s|Hgreedbeacon:%d|h[%s roll]|h|r %s won %s ", roll._type == "Need" and colorneed or colorgreed, i, roll._type or "???", player, link)
0
         for frame,val in pairs(chatframes) do if val then frame:AddMessage(msg) end end
0
         return
0
       end
0
     end
0
- ChatFrame6:AddMessage("GB NO MATCH: "..msg)
0
+ Print("No match found for", msg)
0
     return
0
   end
0
 end)
0
 
0
 
0
 ChatFrame_AddMessageEventFilter("CHAT_MSG_LOOT", function(msg)
0
- if msg:match("(.*) won: (.+)")
0
- or msg:match(" has?v?e? selected .+ for: ")
0
- or msg:match(" Roll . %d+ for .+ by ")
0
- or (msg:match(" passed on: ") and not msg:match("Everyone passed on: ")) then return true end
0
+ if msg:match("(.*) won: (.+)") or msg:match(" has?v?e? selected .+ for: ") or msg:match(" Roll . %d+ for .+ by ") or (msg:match(" passed on: ") and not msg:match("Everyone passed on: ")) then
0
+ Debug("Supressing chat message", msg)
0
+ return true
0
+ end
0
 end)
0
 
0
 
...
6
7
8
9
 
10
11
12
...
6
7
8
 
9
10
11
12
0
@@ -6,7 +6,7 @@
0
 ## Version: Alpha
0
 ## X-Category: Inventory
0
 
0
-## OptionalDeps: tekErr
0
+## OptionalDeps: tekErr, tekDebug
0
 
0
 ## LoadManagers: AddonLoader
0
 ## X-LoadOn-Always: delayed

Comments

    No one has commented yet.