comparison gui.lua @ 28:a7376e6de73c

Drycoded rebroadcast of entire days/bosses, finally.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Sun, 09 Oct 2011 15:51:24 +0000
parents 68d7b903ee17
children f62d582c5c52
comparison
equal deleted inserted replaced
27:68d7b903ee17 28:a7376e6de73c
435 --local gone = tremove(g_loot,rowi) 435 --local gone = tremove(g_loot,rowi)
436 --addon:Print("Removed %s.", 436 --addon:Print("Removed %s.",
437 --gone.itemlink or gone.bosskill or gone.startday.text) 437 --gone.itemlink or gone.bosskill or gone.startday.text)
438 end, 438 end,
439 439
440 -- if kind is boss, also need to stop at new timestamp
441 ["Delete remaining entries for this day"] = function(rowi,kind) 440 ["Delete remaining entries for this day"] = function(rowi,kind)
442 local fencepost 441 -- if kind is boss, also need to stop at new timestamp
443 local closest_time = addon._find_next_after('time',rowi) 442 local fencepost = addon._find_timeboss_fencepost (kind, rowi)
444 if kind == 'time' then
445 fencepost = closest_time
446 elseif kind == 'boss' then
447 local closest_boss = addon._find_next_after('boss',rowi)
448 if not closest_boss then
449 fencepost = closest_time
450 elseif not closest_time then
451 fencepost = closest_boss
452 else
453 fencepost = math.min(closest_time,closest_boss)
454 end
455 end
456 local count = fencepost and (fencepost-rowi) or (#g_loot-rowi+1) 443 local count = fencepost and (fencepost-rowi) or (#g_loot-rowi+1)
457 repeat 444 repeat
458 dropdownfuncs.df_DELETE(rowi) 445 dropdownfuncs.df_DELETE(rowi)
459 count = count - 1 446 count = count - 1
460 until count < 1 447 until count < 1
462 449
463 ["Rebroadcast this loot entry"] = function(rowi) 450 ["Rebroadcast this loot entry"] = function(rowi)
464 local e = g_loot[rowi] 451 local e = g_loot[rowi]
465 -- This only works because GetItemInfo accepts multiple argument formats 452 -- This only works because GetItemInfo accepts multiple argument formats
466 addon:broadcast('loot', e.person, e.itemlink, e.count, e.cols[3].value) 453 addon:broadcast('loot', e.person, e.itemlink, e.count, e.cols[3].value)
467 addon:Print("Rebroadcast entry",rowi,e.itemlink) 454 addon:Print("Rebroadcast entry", rowi, e.itemlink)
468 end, 455 end,
469 456
470 ["Rebroadcast this boss"] = function(rowi,kind) 457 ["Rebroadcast this boss"] = function(rowi,kind)
471 addon:Print("not implemented yet") -- TODO 458 -- if kind is boss, also need to stop at new timestamp
459 local fencepost = addon._find_timeboss_fencepost (kind, rowi) or #g_loot
460 -- this could be a lot of traffic, but frankly it's counterproductive
461 -- to try to micromanage when ChatThrottleLib is already doing so
462 repeat
463 local e = g_loot[rowi]
464 if e.kind == 'boss' then
465 addon:broadcast('boss', e.reason, e.bosskill, e.instance)
466 elseif e.kind == 'loot' then
467 -- This only works because GetItemInfo accepts multiple argument formats
468 addon:broadcast('loot', e.person, e.itemlink, e.count, e.cols[3].value)
469 end
470 addon:Print("Rebroadcast entry", rowi, e.itemlink or e.bosskill or UNKNOWN)
471 rowi = rowi + 1
472 until rowi >= fencepost
472 end, 473 end,
473 474
474 ["Mark as normal"] = function(rowi,disp) -- broadcast the change? ugh 475 ["Mark as normal"] = function(rowi,disp) -- broadcast the change? ugh
475 local olddisp = g_loot[rowi].disposition 476 local olddisp = g_loot[rowi].disposition
476 g_loot[rowi].disposition = disp 477 g_loot[rowi].disposition = disp
579 notClickable = true, 580 notClickable = true,
580 notCheckable = true, 581 notCheckable = true,
581 }}, 582 }},
582 { 583 {
583 "Change from 'wipe' to 'kill'|Also collapses other wipe entries.", 584 "Change from 'wipe' to 'kill'|Also collapses other wipe entries.",
584 "Rebroadcast this boss|Broadcasts the kill event and all subsequent loot until next boss.", 585 "Rebroadcast this boss%boss|Broadcasts the kill event and all subsequent loot until next boss.",
585 "Delete this boss event|Permanent, no going back!", 586 "Delete this boss event|Permanent, no going back!",
586 "Delete remaining entries for this boss%boss|Erases everything from here down until a new boss/day.", 587 "Delete remaining entries for this boss%boss|Erases everything from here down until a new boss/day.",
587 "Insert new loot entry%loot|Inserts new loot above this one, prompting you for information.", 588 "Insert new loot entry%loot|Inserts new loot above this one, prompting you for information.",
588 "Insert new boss kill event%boss|Inserts new event above this one, prompting you for information.", 589 "Insert new boss kill event%boss|Inserts new event above this one, prompting you for information.",
589 "--", 590 "--",