Mercurial > wow > ouroloot
comparison text_tabs.lua @ 109:ce45011fab4c
- Test for errors during startup before trying to manipulate data.
- Thin encapsulation around dispositions. Abstract everything except the
insertion into GUI dropdowns (that comes next).
author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
---|---|
date | Wed, 08 Aug 2012 14:43:26 -0400 |
parents | fe04f5c4114a |
children | 67bf97136273 |
comparison
equal
deleted
inserted
replaced
108:04ccd12c2a41 | 109:ce45011fab4c |
---|---|
59 | 59 |
60 for i = last_printed+1, #loot do | 60 for i = last_printed+1, #loot do |
61 local e = loot[i] | 61 local e = loot[i] |
62 | 62 |
63 if e.kind == 'loot' then | 63 if e.kind == 'loot' then |
64 -- Assuming nobody names a toon "offspec" or "gvault" | 64 local destination = e.person |
65 -- 16Apr2011: armory finds 20 Gvaults and 77 Offspecs... hulk smash. | 65 if e.disposition then |
66 local disp = e.disposition or e.person | 66 local disp = e.disposition |
67 if disp == 'offspec' then | 67 local disptext = addon:_test_disposition(disp,'text') |
68 disp = e.person .. " " .. 'offspec' | 68 if disp == 'offspec' then |
69 elseif disp == 'gvault' then | 69 destination = e.person .. " " .. disptext |
70 --disp = "guild vault (".. e.person .. ")" | 70 elseif disp == 'gvault' then |
71 disp = "guild vault" | 71 --destination = ("%s (%s)"):format(disptext,e.person) |
72 destination = disptext | |
73 else | |
74 destination = disptext | |
75 end | |
72 end | 76 end |
73 if e.extratext_byhand then | 77 if e.extratext_byhand then |
74 disp = disp .. " -- " .. e.extratext | 78 destination = destination .. " -- " .. e.extratext |
75 end | 79 end |
76 if e.variant and not forum_warned_heroic then | 80 if e.variant and not forum_warned_heroic then |
77 forum_warned_heroic = true | 81 forum_warned_heroic = true |
78 addon:Print(warning_text) | 82 addon:Print(warning_text) |
79 end | 83 end |
80 local t = fmt:gsub('%$I', e.id) | 84 local t = fmt:gsub('%$I', e.id) |
81 :gsub('%$N', e.itemname) | 85 :gsub('%$N', e.itemname) |
82 :gsub('%$X', e.count or "") | 86 :gsub('%$X', e.count or "") |
83 :gsub('%$T', disp) | 87 :gsub('%$T', destination) |
84 cache[#cache+1] = t | 88 cache[#cache+1] = t |
85 | 89 |
86 elseif e.kind == 'boss' and e.reason == 'kill' then | 90 elseif e.kind == 'boss' and e.reason == 'kill' then |
87 -- The first boss in an instance gets an instance tag, others | 91 -- The first boss in an instance gets an instance tag, others |
88 -- get a blank line | 92 -- get a blank line |
208 container:AddChild(w) | 212 container:AddChild(w) |
209 end | 213 end |
210 | 214 |
211 addon:register_text_generator ("attend", [[Attendance]], [[Attendance list for each kill]], att, att_specials) | 215 addon:register_text_generator ("attend", [[Attendance]], [[Attendance list for each kill]], att, att_specials) |
212 | 216 |
217 addon.FILES_LOADED = addon.FILES_LOADED + 1 | |
213 -- vim:noet | 218 -- vim:noet |