Mercurial > wow > ouroloot
diff gui.lua @ 114:67bf97136273
- Start paying attention to cross-realm names. New 'fname' and 'realm' keys
in snapshot (now indexed by name only), 'person_realm' key in loot entries.
Realm data not stored if it's the same as the player's realm. Manual
rebroadcasting does not include realm data (do we care?).
- New history_suppress_LFR and history_ignore_xrealm options.
- This implementation depends on no two cross-realm players sharing the same
player name. Is that guaranteed by Blizzard, or merely "unlikely"?
- Gather history suppression knobs into a single function.
- If restoring loot data, make sure the item cache has their values; fix up
any missing data on load.
- Memory tweaks for player history sorting.
- Handle some long-standing FIXME's: reassigning loot to the same player,
using expunge() for history, no partial duplication of effort for
addHistoryEntry.
- Try to be more graceful when discovering messed up history during column 3
display loops. Don't leave History tab in player-focused mode when all
that player's data have been removed elsewhere.
author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
---|---|
date | Mon, 13 Aug 2012 21:49:08 -0400 |
parents | cfbaf001fd52 |
children | fc2ff128835a |
line wrap: on
line diff
--- a/gui.lua Fri Aug 10 00:07:35 2012 -0400 +++ b/gui.lua Mon Aug 13 21:49:08 2012 -0400 @@ -340,7 +340,8 @@ if e == nil then self.loot_clean = nil pprint('_f_o_e_d', "index",i,"somehow still in loop past",#g_loot,"bailing") - return + -- hmm. used to bail here. does restarting cause problems? + return self:_fill_out_eoi_data(1) end local display_bcast_from = self.db.profile.display_bcast_from @@ -350,9 +351,11 @@ -- garbage for now. if e.kind == 'loot' then local textured = eoi_st_textured_item_format:format (e.itexture, ITEM_QUALITY_COLORS[e.quality].hex, e.itemname, e.count or "") + local pdisplay = e.person_realm + and (e.person .. FOREIGN_SERVER_LABEL) or e.person e.cols = { {value = textured}, - {value = e.person}, + {value = pdisplay}, {} } -- This is horrible. Must do better. @@ -460,7 +463,12 @@ col2.OLi = li col2.OLu = unique local col3 = new() - col3.value = assert(player.when[unique]) + col3.value = player.when[unique] + + if not col3.value then + col3.hist_miss = true + col3.value = '??' + end local id = assert(player.id[unique]) local itexture = GetItemIcon(id) @@ -1055,6 +1063,7 @@ local e = data[realrow] if e == nil then return end -- something horrible has happened local kind = e.kind + local cell = e.cols[column] local tt = GameTooltip -- can this be hoisted? does GT ever get securely replaced? if gui._do_debugging_tooltip and column == 1 and kind ~= 'hist' then @@ -1076,7 +1085,8 @@ elseif kind == 'loot' and column == 2 then tt:SetOwner (cellFrame, "ANCHOR_BOTTOMRIGHT", -50, 5) tt:ClearLines() - tt:AddLine(e.person.." Loot:") + tt:AddLine(("%s Loot:"):format(e.person_realm + and (e.person .. "-" .. e.person_realm) or e.person)) local counter = 0 for i,e2 in ipairs(data) do if e2.person == e.person then -- would be awesome to test for alts @@ -1095,7 +1105,16 @@ tt:Show() elseif kind == 'loot' and column == 3 then - setstatus(e.cols[column].value) + setstatus(cell.value) + + elseif kind == 'hist' and column == 3 and cell.hist_miss then + tt:SetOwner (cellFrame, "ANCHOR_RIGHT", -20, 0) + tt:ClearLines() + tt:AddLine("Corrupted History Data") + tt:AddLine([[Close this window, then type]], 0.8, 0.8, 0.8, 1) + tt:AddLine([[/ouroloot fix history]], 0, 1, 64/255, nil) + tt:AddLine([[and redisplay this window.]], 0.8, 0.8, 0.8, 1) + tt:Show() end @@ -1144,7 +1163,7 @@ elseif kind == 'loot' and column == 2 then local ddep = gui.dropdown.eoi_player - ddep[1].text = e.person + ddep[1].text = e.person -- FIXME realm this too local raiders = {} for i = 1, GetNumRaidMembers() do tinsert (raiders, (GetRaidRosterInfo(i))) @@ -1812,7 +1831,15 @@ st_widget.tail_offset = 0 container:SetLayout("Fill") container:AddChild(st_widget) - setstatus(hist_normal_status) + -- If we're focused on one player, but have deleted all entries for + -- that player, don't sit there stuck on a blank grid. + if history_filter_who and #histST.filtered < 1 then + history_filter_who = nil + histST:SetFilter(history_filter_by_recent) + setstatus(hist_normal_status) + else + setstatus(hist_name_status) + end local b do