diff 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
line wrap: on
line diff
--- a/gui.lua	Sat Apr 07 05:40:20 2012 +0000
+++ b/gui.lua	Fri Apr 13 04:28:46 2012 +0000
@@ -47,7 +47,8 @@
 local window_title		= "Ouro Loot"
 local dirty_tabs		= nil
 
-local pairs, ipairs, tinsert, tremove, tonumber = pairs, ipairs, table.insert, table.remove, tonumber
+local pairs, ipairs, tinsert, tremove, tostring, tonumber =
+	pairs, ipairs, table.insert, table.remove, tostring, tonumber
 
 local pprint, tabledump = addon.pprint, flib.tabledump
 local GetItemInfo, ITEM_QUALITY_COLORS = GetItemInfo, ITEM_QUALITY_COLORS
@@ -164,9 +165,11 @@
 			_tabtexts[tabtitle] = nil
 			tremove (_taborder, loaded_at)
 			next_insertion_position = loaded_at
+			local saved_next_insertion_position = loaded_at
 			local loaded, whynot = LoadAddOn(addon_index)
 			if loaded then
-				addon:Print(tabtitle, "loaded.")
+				addon:Print("%s loaded.  %d |4tab:tabs; added.", tabtitle,
+					next_insertion_position - saved_next_insertion_position)
 			else
 				what.disabled = true
 				_tabtexts[tabtitle] = what -- restore this for mouseovers
@@ -541,7 +544,7 @@
 	["Rebroadcast this loot entry"] = function(rowi)
 		local e = g_loot[rowi]
 		-- This only works because GetItemInfo accepts multiple argument formats
-		addon:broadcast('loot', e.person, e.itemlink, e.count, e.cols[3].value)
+		addon:vbroadcast('loot', e.person, e.itemlink, e.count, e.cols[3].value)
 		addon:Print("Rebroadcast entry", rowi, e.itemlink)
 	end,
 
@@ -553,10 +556,10 @@
 		repeat
 			local e = g_loot[rowi]
 			if e.kind == 'boss' then
-				addon:broadcast('boss', e.reason, e.bossname, e.instance)
+				addon:vbroadcast('boss', e.reason, e.bossname, e.instance)
 			elseif e.kind == 'loot' then
 				-- This only works because GetItemInfo accepts multiple argument formats
-				addon:broadcast('loot', e.person, e.itemlink, e.count, e.cols[3].value)
+				addon:vbroadcast('loot', e.person, e.itemlink, e.count, e.cols[3].value)
 			end
 			addon:Print("Rebroadcast entry", rowi, e.itemlink or e.bossname or UNKNOWN)
 			rowi = rowi + 1
@@ -2162,7 +2165,7 @@
 		data.name = text
 		local getinstance = StaticPopup_Show("OUROL_EOI_INSERT","instance")
 		getinstance.data = data
-		getinstance.editBox:SetText(addon.instance_tag())
+		getinstance.editBox:SetText((addon.instance_tag()))
 		-- This suppresses auto-hide (which would case the getinstance dialog
 		-- to go away), but only when mouse clicking.  OnEnter is on its own.
 		return true