Mercurial > wow > ouroloot
comparison gui.lua @ 71:fb330a1fb6e9
Add a unique field to loot (extracted from uniqueID field when possible, randomly generated when not) and include it in broadcasts. Use this as a history identifier for future loot. Will need to tweak using this in signatures (and finally avoid problems looting multiples of an item to a single person).
author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
---|---|
date | Sat, 12 May 2012 07:17:55 +0000 |
parents | cdee65c1bd8c |
children | bb19899c65a7 |
comparison
equal
deleted
inserted
replaced
70:cdee65c1bd8c | 71:fb330a1fb6e9 |
---|---|
462 end | 462 end |
463 | 463 |
464 | 464 |
465 -- Done at startup, and whenever we've changed the population of tabs. | 465 -- Done at startup, and whenever we've changed the population of tabs. |
466 function addon:gui_init (loot_pointer) | 466 function addon:gui_init (loot_pointer) |
467 g_loot = loot_pointer | 467 g_loot = assert(loot_pointer, "something went wrong at startup") |
468 g_generated = nil | 468 g_generated = nil |
469 tabgroup_tabs = {} | 469 tabgroup_tabs = {} |
470 window_title = "Ouro Loot " .. self.revision | 470 window_title = "Ouro Loot " .. self.revision |
471 -- TabGroup stretches out the tabs to fill the row but only if >75% of the | 471 -- TabGroup stretches out the tabs to fill the row but only if >75% of the |
472 -- row is already full. It turns out that not doing this looks like ass. | 472 -- row is already full. It turns out that not doing this looks like ass. |
577 end, | 577 end, |
578 | 578 |
579 ["Rebroadcast this loot entry"] = function(rowi) | 579 ["Rebroadcast this loot entry"] = function(rowi) |
580 local e = g_loot[rowi] | 580 local e = g_loot[rowi] |
581 -- This only works because GetItemInfo accepts multiple argument formats | 581 -- This only works because GetItemInfo accepts multiple argument formats |
582 addon:vbroadcast('loot', e.person, e.itemlink, e.count, e.cols[3].value) | 582 addon:vbroadcast('loot', e.person, e.unique, e.itemlink, e.count, e.cols[3].value) |
583 addon:Print("Rebroadcast entry", rowi, e.itemlink) | 583 addon:Print("Rebroadcast entry", rowi, e.itemlink) |
584 end, | 584 end, |
585 | 585 |
586 ["Rebroadcast this boss"] = function(rowi,kind) | 586 ["Rebroadcast this boss"] = function(rowi,kind) |
587 -- if kind is boss, also need to stop at new timestamp | 587 -- if kind is boss, also need to stop at new timestamp |
592 local e = g_loot[rowi] | 592 local e = g_loot[rowi] |
593 if e.kind == 'boss' then | 593 if e.kind == 'boss' then |
594 addon:vbroadcast('boss', e.reason, e.bossname, e.instance) | 594 addon:vbroadcast('boss', e.reason, e.bossname, e.instance) |
595 elseif e.kind == 'loot' then | 595 elseif e.kind == 'loot' then |
596 -- This only works because GetItemInfo accepts multiple argument formats | 596 -- This only works because GetItemInfo accepts multiple argument formats |
597 addon:vbroadcast('loot', e.person, e.itemlink, e.count, e.cols[3].value) | 597 addon:vbroadcast('loot', e.person, e.unique, e.itemlink, e.count, e.cols[3].value) |
598 end | 598 end |
599 addon:Print("Rebroadcast entry", rowi, e.itemlink or e.bossname or UNKNOWN) | 599 addon:Print("Rebroadcast entry", rowi, e.itemlink or e.bossname or UNKNOWN) |
600 rowi = rowi + 1 | 600 rowi = rowi + 1 |
601 until rowi >= fencepost | 601 until rowi >= fencepost |
602 end, | 602 end, |