comparison gui.lua @ 56:fcc0d0ff5832

- instance_tag() also returns max instance size as a plain number, adjust call sites - clean up .raiders table, add some new fields, use copies of this instead of a single string - make sure datarev field is properly updated when it's already present - avoid multiple GetRaidRosterInfo loops scattered throughout the addon, instead just traverse the .raiders list, regularly updated - make the 'loot' and 'boss' broadcasts versioned. Handle receiving older. - new format for plaintext attendance output
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Fri, 13 Apr 2012 04:28:46 +0000
parents ac57a4342812
children 81d5449621f8
comparison
equal deleted inserted replaced
55:ac57a4342812 56:fcc0d0ff5832
45 local g_loot = nil 45 local g_loot = nil
46 local g_generated = nil 46 local g_generated = nil
47 local window_title = "Ouro Loot" 47 local window_title = "Ouro Loot"
48 local dirty_tabs = nil 48 local dirty_tabs = nil
49 49
50 local pairs, ipairs, tinsert, tremove, tonumber = pairs, ipairs, table.insert, table.remove, tonumber 50 local pairs, ipairs, tinsert, tremove, tostring, tonumber =
51 pairs, ipairs, table.insert, table.remove, tostring, tonumber
51 52
52 local pprint, tabledump = addon.pprint, flib.tabledump 53 local pprint, tabledump = addon.pprint, flib.tabledump
53 local GetItemInfo, ITEM_QUALITY_COLORS = GetItemInfo, ITEM_QUALITY_COLORS 54 local GetItemInfo, ITEM_QUALITY_COLORS = GetItemInfo, ITEM_QUALITY_COLORS
54 55
55 -- En masse forward decls of symbols defined inside local blocks 56 -- En masse forward decls of symbols defined inside local blocks
162 local real_nip = next_insertion_position 163 local real_nip = next_insertion_position
163 local function LOAD() 164 local function LOAD()
164 _tabtexts[tabtitle] = nil 165 _tabtexts[tabtitle] = nil
165 tremove (_taborder, loaded_at) 166 tremove (_taborder, loaded_at)
166 next_insertion_position = loaded_at 167 next_insertion_position = loaded_at
168 local saved_next_insertion_position = loaded_at
167 local loaded, whynot = LoadAddOn(addon_index) 169 local loaded, whynot = LoadAddOn(addon_index)
168 if loaded then 170 if loaded then
169 addon:Print(tabtitle, "loaded.") 171 addon:Print("%s loaded. %d |4tab:tabs; added.", tabtitle,
172 next_insertion_position - saved_next_insertion_position)
170 else 173 else
171 what.disabled = true 174 what.disabled = true
172 _tabtexts[tabtitle] = what -- restore this for mouseovers 175 _tabtexts[tabtitle] = what -- restore this for mouseovers
173 addon:Print("%s could not load (game client reason was '%s').", tabtitle, whynot) 176 addon:Print("%s could not load (game client reason was '%s').", tabtitle, whynot)
174 DisableAddOn(addon_index) 177 DisableAddOn(addon_index)
539 end, 542 end,
540 543
541 ["Rebroadcast this loot entry"] = function(rowi) 544 ["Rebroadcast this loot entry"] = function(rowi)
542 local e = g_loot[rowi] 545 local e = g_loot[rowi]
543 -- This only works because GetItemInfo accepts multiple argument formats 546 -- This only works because GetItemInfo accepts multiple argument formats
544 addon:broadcast('loot', e.person, e.itemlink, e.count, e.cols[3].value) 547 addon:vbroadcast('loot', e.person, e.itemlink, e.count, e.cols[3].value)
545 addon:Print("Rebroadcast entry", rowi, e.itemlink) 548 addon:Print("Rebroadcast entry", rowi, e.itemlink)
546 end, 549 end,
547 550
548 ["Rebroadcast this boss"] = function(rowi,kind) 551 ["Rebroadcast this boss"] = function(rowi,kind)
549 -- if kind is boss, also need to stop at new timestamp 552 -- if kind is boss, also need to stop at new timestamp
551 -- this could be a lot of traffic, but frankly it's counterproductive 554 -- this could be a lot of traffic, but frankly it's counterproductive
552 -- to try to micromanage when ChatThrottleLib is already doing so 555 -- to try to micromanage when ChatThrottleLib is already doing so
553 repeat 556 repeat
554 local e = g_loot[rowi] 557 local e = g_loot[rowi]
555 if e.kind == 'boss' then 558 if e.kind == 'boss' then
556 addon:broadcast('boss', e.reason, e.bossname, e.instance) 559 addon:vbroadcast('boss', e.reason, e.bossname, e.instance)
557 elseif e.kind == 'loot' then 560 elseif e.kind == 'loot' then
558 -- This only works because GetItemInfo accepts multiple argument formats 561 -- This only works because GetItemInfo accepts multiple argument formats
559 addon:broadcast('loot', e.person, e.itemlink, e.count, e.cols[3].value) 562 addon:vbroadcast('loot', e.person, e.itemlink, e.count, e.cols[3].value)
560 end 563 end
561 addon:Print("Rebroadcast entry", rowi, e.itemlink or e.bossname or UNKNOWN) 564 addon:Print("Rebroadcast entry", rowi, e.itemlink or e.bossname or UNKNOWN)
562 rowi = rowi + 1 565 rowi = rowi + 1
563 until rowi >= fencepost 566 until rowi >= fencepost
564 end, 567 end,
2160 -- first click 2163 -- first click
2161 if text then 2164 if text then
2162 data.name = text 2165 data.name = text
2163 local getinstance = StaticPopup_Show("OUROL_EOI_INSERT","instance") 2166 local getinstance = StaticPopup_Show("OUROL_EOI_INSERT","instance")
2164 getinstance.data = data 2167 getinstance.data = data
2165 getinstance.editBox:SetText(addon.instance_tag()) 2168 getinstance.editBox:SetText((addon.instance_tag()))
2166 -- This suppresses auto-hide (which would case the getinstance dialog 2169 -- This suppresses auto-hide (which would case the getinstance dialog
2167 -- to go away), but only when mouse clicking. OnEnter is on its own. 2170 -- to go away), but only when mouse clicking. OnEnter is on its own.
2168 return true 2171 return true
2169 end 2172 end
2170 end 2173 end