Mercurial > wow > ouroloot
comparison text_tabs.lua @ 61:99ab21f0755f
Fix major breakage in attendance snapshotting.
author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
---|---|
date | Thu, 19 Apr 2012 00:52:37 +0000 |
parents | 45d2b153c2df |
children | 69fd720f853e |
comparison
equal
deleted
inserted
replaced
60:45d2b153c2df | 61:99ab21f0755f |
---|---|
94 elseif e.kind == 'time' then | 94 elseif e.kind == 'time' then |
95 cache[#cache+1] = "[b]" .. e.startday.text .. "[/b]" | 95 cache[#cache+1] = "[b]" .. e.startday.text .. "[/b]" |
96 | 96 |
97 end | 97 end |
98 end | 98 end |
99 return true | 99 return #cache > 0 |
100 end | 100 end |
101 | 101 |
102 local function forum_specials (_,_, container, mkbutton) | 102 local function forum_specials (_,_, container, mkbutton) |
103 local map,current = {} | 103 local map,current = {} |
104 for label,format in pairs(OuroLootSV_opts.forum) do | 104 for label,format in pairs(OuroLootSV_opts.forum) do |
166 wipe(ingroups) | 166 wipe(ingroups) |
167 wipe(outgroups) | 167 wipe(outgroups) |
168 return i,o | 168 return i,o |
169 end | 169 end |
170 | 170 |
171 local saved_g_loot_pointer | |
172 local function att (_, loot, last_printed, _, cache) | 171 local function att (_, loot, last_printed, _, cache) |
173 saved_g_loot_pointer = loot | |
174 for i = last_printed+1, #loot do | 172 for i = last_printed+1, #loot do |
175 local e = loot[i] | 173 local e = loot[i] |
176 | 174 |
177 if e.kind == 'boss' and e.reason == 'kill' then | 175 if e.kind == 'boss' and e.reason == 'kill' then |
178 -- This could, concievably, be different on a per-boss basis | 176 -- This could, concievably, be different on a per-boss basis |
185 elseif e.kind == 'time' then | 183 elseif e.kind == 'time' then |
186 cache[#cache+1] = e.startday.text | 184 cache[#cache+1] = e.startday.text |
187 | 185 |
188 end | 186 end |
189 end | 187 end |
190 return true | 188 return #cache > 0 |
191 end | 189 end |
192 | 190 |
193 local function att_specials (_, editbox, container, mkbutton) | 191 local function att_specials (_, editbox, container, mkbutton) |
194 local w = mkbutton("Take Attendance", | 192 local w = mkbutton("Take Attendance", |
195 [[Take attendance now (will continue to take attendance on each boss kill).]]) | 193 [[Take attendance now (will continue to take attendance on each boss kill).]]) |
196 w:SetFullWidth(true) | 194 w:SetFullWidth(true) |
197 w:SetCallback("OnClick", function(_w) | 195 w:SetCallback("OnClick", function(_w) |
198 local instance, maxsize = addon.instance_tag() | 196 local ss,max,instance = addon:snapshot_raid (--[[inraid=]]true) |
199 local i,o = do_attendance (saved_g_loot_pointer.raiders, maxsize / MEMBERS_PER_RAID_GROUP) | 197 local i,o = do_attendance (ss, max / MEMBERS_PER_RAID_GROUP) |
200 local h, m = GetGameTime() | 198 local h, m = GetGameTime() |
201 | 199 |
202 local additional = ("Attendance for %s at %.2d:%.2d:\n{+} %s\n{-} %s"):format(instance, h, m, i, o) | 200 local additional = ("Attendance for %s at %.2d:%.2d:\n{+} %s\n{-} %s"): |
201 format(instance, h, m, i, o) | |
203 editbox:SetText(editbox:GetText() .. '\n' .. additional) | 202 editbox:SetText(editbox:GetText() .. '\n' .. additional) |
204 end) | 203 end) |
205 container:AddChild(w) | 204 container:AddChild(w) |
206 end | 205 end |
207 | 206 |