Mercurial > wow > ouroloot
comparison gui.lua @ 118:ec5174529e0f
Make more use of g_loot.raiders in the GUI rather than calling GRRI each time.
| author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
|---|---|
| date | Thu, 16 Aug 2012 23:04:29 -0400 |
| parents | fc2ff128835a |
| children | fb4bda3ad05c |
comparison
equal
deleted
inserted
replaced
| 117:dbdab3780757 | 118:ec5174529e0f |
|---|---|
| 158 __index = real, | 158 __index = real, |
| 159 __newindex = real, | 159 __newindex = real, |
| 160 cols = {}, | 160 cols = {}, |
| 161 } | 161 } |
| 162 if real.kind == 'loot' then | 162 if real.kind == 'loot' then |
| 163 e.dperson = real.person_realm and | 163 if real.person_realm then |
| 164 (real.person .. FOREIGN_SERVER_LABEL) or real.person | 164 e.dperson = real.person .. FOREIGN_SERVER_LABEL |
| 165 e.fperson = real.person .. "-" .. real.person_realm | |
| 166 else | |
| 167 e.dperson = real.person | |
| 168 e.fperson = real.person | |
| 169 end | |
| 165 end | 170 end |
| 166 setmetatable(e,e) | 171 setmetatable(e,e) |
| 167 rawset(t,index,e) | 172 rawset(t,index,e) |
| 168 return e | 173 return e |
| 169 end | 174 end |
| 1120 end | 1125 end |
| 1121 | 1126 |
| 1122 elseif kind == 'loot' and column == 2 then | 1127 elseif kind == 'loot' and column == 2 then |
| 1123 tt:SetOwner (cellFrame, "ANCHOR_BOTTOMRIGHT", -50, 5) | 1128 tt:SetOwner (cellFrame, "ANCHOR_BOTTOMRIGHT", -50, 5) |
| 1124 tt:ClearLines() | 1129 tt:ClearLines() |
| 1125 tt:AddLine(("%s Loot:"):format(e.person_realm | 1130 tt:AddLine(e.fperson .. " Loot:") |
| 1126 and (e.person .. "-" .. e.person_realm) or e.person)) | |
| 1127 local counter = 0 | 1131 local counter = 0 |
| 1128 for i,e2 in ipairs(data) do | 1132 for i,e2 in ipairs(data) do |
| 1129 if e2.person == e.person then -- would be awesome to test for alts | 1133 if e2.person == e.person then -- would be awesome to test for alts |
| 1130 if counter > 10 then | 1134 if counter > 10 then |
| 1131 tt:AddLine("...") | 1135 tt:AddLine("...") |
| 1198 gui.dropdown.eoi_loot[1].text = e.itemlink | 1202 gui.dropdown.eoi_loot[1].text = e.itemlink |
| 1199 EasyMenu (gui.dropdown.eoi_loot, dropdownmenuframe, cellFrame, 0, 0, "MENU") | 1203 EasyMenu (gui.dropdown.eoi_loot, dropdownmenuframe, cellFrame, 0, 0, "MENU") |
| 1200 | 1204 |
| 1201 elseif kind == 'loot' and column == 2 then | 1205 elseif kind == 'loot' and column == 2 then |
| 1202 local ddep = gui.dropdown.eoi_player | 1206 local ddep = gui.dropdown.eoi_player |
| 1203 ddep[1].text = e.person -- FIXME realm this too | 1207 ddep[1].text = e.fperson |
| 1204 local raiders = {} | 1208 local raiders = {} |
| 1205 for i = 1, GetNumRaidMembers() do | 1209 for i, name, info in addon:sorted_raiders_iter() do |
| 1206 tinsert (raiders, (GetRaidRosterInfo(i))) | 1210 raiders[i] = gen_dd_entry (info.fname or name, eoi_dropdownfuncs, |
| 1207 end | 1211 'df_REASSIGN', name) |
| 1208 table.sort(raiders) | 1212 if info.online == 'offline' then |
| 1209 for i = 1, #raiders do | 1213 raiders[i].colorCode = GRAY_FONT_COLOR_CODE |
| 1210 local name = raiders[i] | 1214 elseif info.online == 'no_longer' then |
| 1211 raiders[i] = gen_dd_entry (name, eoi_dropdownfuncs, 'df_REASSIGN', name) | 1215 raiders[i].colorCode = RED_FONT_COLOR_CODE |
| 1216 end | |
| 1212 end | 1217 end |
| 1213 tinsert (raiders, gen_dd_entry ("Enter name...", eoi_dropdownfuncs)) | 1218 tinsert (raiders, gen_dd_entry ("Enter name...", eoi_dropdownfuncs)) |
| 1214 tinsert (raiders, gen_dd_entry (CLOSE, eoi_dropdownfuncs)) | 1219 tinsert (raiders, gen_dd_entry (CLOSE, eoi_dropdownfuncs)) |
| 1215 ddep[2].menuList = raiders | 1220 ddep[2].menuList = raiders |
| 1216 | 1221 |
| 1508 _b:SetDisabled(true) | 1513 _b:SetDisabled(true) |
| 1509 end) | 1514 end) |
| 1510 b:SetDisabled(st.Filter == player_filter_all) | 1515 b:SetDisabled(st.Filter == player_filter_all) |
| 1511 specials:AddChild(b) | 1516 specials:AddChild(b) |
| 1512 | 1517 |
| 1513 -- FIXME iterate over the new raiders table instead | |
| 1514 local people = { "<nobody>" } | 1518 local people = { "<nobody>" } |
| 1515 for i = 1, GetNumRaidMembers() do | |
| 1516 tinsert(people,(GetRaidRosterInfo(i))) | |
| 1517 end | |
| 1518 table.sort(people) | |
| 1519 local initial | 1519 local initial |
| 1520 for i,n in ipairs(people) do | 1520 for i, name, info in |
| 1521 if n == addon.sharder then initial = i end | 1521 addon:sorted_raiders_iter (--[[fullnames=]]true, 'online') |
| 1522 do | |
| 1523 tinsert (people, name) | |
| 1524 if name == addon.sharder then | |
| 1525 initial = i + 1 -- +1 offset for "nobody" | |
| 1526 end | |
| 1522 end | 1527 end |
| 1523 b = mkbutton("Dropdown", nil, "", | 1528 b = mkbutton("Dropdown", nil, "", |
| 1524 [[If set, items received by this person will be automatically marked as disenchanted.]]) | 1529 [[If set, items received by this person will be automatically marked as disenchanted.]]) |
| 1525 b:SetFullWidth(true) | 1530 b:SetFullWidth(true) |
| 1526 b:SetLabel("Auto-mark as shard:") | 1531 b:SetLabel("Auto-mark as shard:") |
