Mercurial > wow > ouroloot
comparison gui.lua @ 116:fc2ff128835a
- Reset the 'clean' markers on all default-function option toggles.
- Fix a long-standing FIXME: Move all lib-scrollingtable and other
"display-only" data out of g_loot entries and into their own subclass-
style table; feed that to ST's SetData instead. No more 'cols'.
| author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
|---|---|
| date | Thu, 16 Aug 2012 17:11:57 -0400 |
| parents | 67bf97136273 |
| children | ec5174529e0f |
comparison
equal
deleted
inserted
replaced
| 115:289c7667adab | 116:fc2ff128835a |
|---|---|
| 12 | 12 |
| 13 ------ Constants | 13 ------ Constants |
| 14 local eoi_st_rowheight = 20 | 14 local eoi_st_rowheight = 20 |
| 15 local eoi_st_displayed_rows = math.floor(416/eoi_st_rowheight) | 15 local eoi_st_displayed_rows = math.floor(416/eoi_st_rowheight) |
| 16 local eoi_st_textured_item_format = "|T%s:"..(eoi_st_rowheight-2).."|t %s[%s]|r%s" | 16 local eoi_st_textured_item_format = "|T%s:"..(eoi_st_rowheight-2).."|t %s[%s]|r%s" |
| 17 local eoi_st_cols -- defined below | |
| 17 -- This can get indexed by kind/reason/etc, and will default to lib-st's | 18 -- This can get indexed by kind/reason/etc, and will default to lib-st's |
| 18 -- default "blank" background at runtime. | 19 -- default "blank" background at runtime. |
| 19 local eoi_st_otherrow_bgcolortable = { | 20 local eoi_st_otherrow_bgcolortable = { |
| 20 wipe = { ["r"] = 0.3, ["g"] = 0.3, ["b"] = 0.3}, | 21 wipe = { ["r"] = 0.3, ["g"] = 0.3, ["b"] = 0.3}, |
| 21 kill = { ["r"] = 0.2, ["g"] = 0.2, ["b"] = 0.2}, | 22 kill = { ["r"] = 0.2, ["g"] = 0.2, ["b"] = 0.2}, |
| 25 local eoi_st_otherrow_bgcolortable_default | 26 local eoi_st_otherrow_bgcolortable_default |
| 26 local eoi_st_lootrow_col3_colortable = addon.disposition_colors | 27 local eoi_st_lootrow_col3_colortable = addon.disposition_colors |
| 27 local function eoi_st_lootrow_col3_colortable_func (data, _, realrow) | 28 local function eoi_st_lootrow_col3_colortable_func (data, _, realrow) |
| 28 return eoi_st_lootrow_col3_colortable[data[realrow].disposition] | 29 return eoi_st_lootrow_col3_colortable[data[realrow].disposition] |
| 29 end | 30 end |
| 30 local time_column1_used_mt = { __index = { | |
| 31 [2] = {value=""}, | |
| 32 [3] = {value=""}, | |
| 33 } } | |
| 34 | 31 |
| 35 | 32 |
| 36 ------ Globals | 33 ------ Globals |
| 37 local AceGUI = LibStub("AceGUI-3.0") | 34 local AceGUI = LibStub("AceGUI-3.0") |
| 38 local flib = LibStub("LibFarmbuyer") | 35 local flib = LibStub("LibFarmbuyer") |
| 55 if addon.author_debug then | 52 if addon.author_debug then |
| 56 _G.OLgui = gui | 53 _G.OLgui = gui |
| 57 end | 54 end |
| 58 | 55 |
| 59 local g_loot = nil | 56 local g_loot = nil |
| 57 local g_dloot = nil -- GUI-related "child" of the main table | |
| 60 local g_uniques = nil | 58 local g_uniques = nil |
| 61 local g_generated = nil | 59 local g_generated = nil |
| 62 local window_title = "Ouro Loot" | 60 local window_title = "Ouro Loot" |
| 63 local dirty_tabs = nil | 61 local dirty_tabs = nil |
| 64 | 62 |
| 127 end | 125 end |
| 128 end | 126 end |
| 129 | 127 |
| 130 -- To fix Blizzard's bug caused by the new "self:SetFrameLevel(2);" | 128 -- To fix Blizzard's bug caused by the new "self:SetFrameLevel(2);" |
| 131 hooksecurefunc("UIDropDownMenu_CreateFrames", fix_menu_frame_levels) | 129 hooksecurefunc("UIDropDownMenu_CreateFrames", fix_menu_frame_levels) |
| 130 end | |
| 131 | |
| 132 | |
| 133 local do_g_loot_wrap | |
| 134 do | |
| 135 local FOREIGN_SERVER_LABEL = FOREIGN_SERVER_LABEL | |
| 136 local wrappers = { | |
| 137 -- WTB Lua 5.2 instead of this | |
| 138 ["LEN"] = function() | |
| 139 return #g_loot | |
| 140 end, | |
| 141 -- returns the display's entry and the core entry | |
| 142 ["remove"] = function (dt, i) | |
| 143 local reale = tremove (g_loot, i) | |
| 144 return tremove (dt, i), reale | |
| 145 end, | |
| 146 -- counterpart | |
| 147 --[[ | |
| 148 ["insert"] = function (dt, i, displaye, reale) | |
| 149 tinsert (g_loot, i, reale) | |
| 150 tinsert (dt, i, displaye) | |
| 151 end,]] | |
| 152 } | |
| 153 local function wrap_e (t,index) | |
| 154 local real = g_loot[index] | |
| 155 if not real then return nil end | |
| 156 | |
| 157 local e = { | |
| 158 __index = real, | |
| 159 __newindex = real, | |
| 160 cols = {}, | |
| 161 } | |
| 162 if real.kind == 'loot' then | |
| 163 e.dperson = real.person_realm and | |
| 164 (real.person .. FOREIGN_SERVER_LABEL) or real.person | |
| 165 end | |
| 166 setmetatable(e,e) | |
| 167 rawset(t,index,e) | |
| 168 return e | |
| 169 end | |
| 170 function do_g_loot_wrap (g) | |
| 171 local dl = {} | |
| 172 for k,v in pairs(wrappers) do | |
| 173 dl[k] = v | |
| 174 end | |
| 175 for i,e in ipairs(g) do | |
| 176 wrap_e (dl, i) | |
| 177 end | |
| 178 return setmetatable(dl, { | |
| 179 __index = wrap_e, | |
| 180 }) | |
| 181 end | |
| 132 end | 182 end |
| 133 | 183 |
| 134 | 184 |
| 135 ------ Behind the scenes routines | 185 ------ Behind the scenes routines |
| 136 -- Text generation | 186 -- Text generation |
| 311 end | 361 end |
| 312 | 362 |
| 313 --[[ | 363 --[[ |
| 314 The g_loot table is populated only with "behavior-relevant" data (names, | 364 The g_loot table is populated only with "behavior-relevant" data (names, |
| 315 links, etc). This function runs through it and fills out the "display- | 365 links, etc). This function runs through it and fills out the "display- |
| 316 relevant" bits (icons, user-friendly labels, etc). Everything from the | 366 relevant" bits (icons, user-friendly labels, etc) in the g_dloot table, |
| 317 loot_clean index to the end of the table is filled out, loot_clean is | 367 which inherits (so to speak) the corresponding row entries. |
| 318 updated. Override the starting point with the argument. | 368 |
| 319 | 369 Everything from the loot_clean index to the end of the table is filled out; |
| 320 XXX blizzard's scrolling update and lib-st keep finding some way of displaying | 370 loot_clean is updated. Override this starting point with the function arg. |
| 321 the grid without ever calling the hooked refresh, thereby skipping this | |
| 322 function and erroring on missing columnar data. fuckit. from now on | |
| 323 this function gets called everywhere, all the time, and loops over the | |
| 324 entire goddamn table each time. If we can't find blizz's scrollframe bugs, | |
| 325 we'll just work around them. Sorry for your smoking CPU. | |
| 326 | |
| 327 FIXME just move this functionality to a per-entry function and call it once | |
| 328 in _addlootentry. --actually no, then the columnar data won't be updated once | |
| 329 the backend data is changed on the fly. | |
| 330 ]] | 371 ]] |
| 331 do | 372 function addon:_fill_out_eoi_data (opt_starting_index) |
| 332 function addon:_fill_out_eoi_data (opt_starting_index) | 373 if #g_loot < 1 then |
| 333 if #g_loot < 1 then | 374 --pprint('_f_o_e_d', "#g_loot<1") |
| 334 --pprint('_f_o_e_d', "#g_loot<1") | 375 self.loot_clean = nil |
| 376 opt_starting_index = nil | |
| 377 end | |
| 378 | |
| 379 local display_bcast_from = self.db.profile.display_bcast_from | |
| 380 local colcount = #eoi_st_cols | |
| 381 | |
| 382 -- 'while true' so that we can use (inner) break as (outer) continue | |
| 383 for i = (opt_starting_index or self.loot_clean or 1), #g_loot do while true do | |
| 384 local e = g_dloot[i] | |
| 385 if e == nil then | |
| 335 self.loot_clean = nil | 386 self.loot_clean = nil |
| 336 opt_starting_index = nil | 387 pprint('_f_o_e_d', "index",i,"somehow still in loop past",#g_loot,"bailing") |
| 337 end | 388 -- hmm. used to bail here. does restarting instead cause problems? |
| 338 for i = (opt_starting_index or self.loot_clean or 1), #g_loot do | 389 return self:_fill_out_eoi_data(1) |
| 339 local e = g_loot[i] | 390 end |
| 340 if e == nil then | 391 |
| 341 self.loot_clean = nil | 392 assert(type(rawget(e,'cols'))=='table') |
| 342 pprint('_f_o_e_d', "index",i,"somehow still in loop past",#g_loot,"bailing") | 393 |
| 343 -- hmm. used to bail here. does restarting cause problems? | 394 while #e.cols < colcount do |
| 344 return self:_fill_out_eoi_data(1) | 395 e.cols[#e.cols+1] = {} |
| 345 end | 396 end |
| 346 | 397 |
| 347 local display_bcast_from = self.db.profile.display_bcast_from | 398 if e.kind == 'loot' then |
| 348 -- XXX FIXME a major weakness here is that we're constantly replacing | 399 local textured = eoi_st_textured_item_format:format (e.itexture, |
| 349 -- what's already been created. Lots of garbage. Trying to detect what | 400 ITEM_QUALITY_COLORS[e.quality].hex, e.itemname, e.count or "") |
| 350 -- actually needs to be replaced is even worse. We'll live with | 401 e.cols[1].value = textured |
| 351 -- garbage for now. | 402 e.cols[2].value = e.dperson |
| 352 if e.kind == 'loot' then | 403 -- This is horrible. Must do better. |
| 353 local textured = eoi_st_textured_item_format:format (e.itexture, ITEM_QUALITY_COLORS[e.quality].hex, e.itemname, e.count or "") | 404 if e.extratext then |
| 354 local pdisplay = e.person_realm | 405 for disp,text in self:_iter_dispositions('from_notes_text') do |
| 355 and (e.person .. FOREIGN_SERVER_LABEL) or e.person | 406 if text == e.extratext then |
| 356 e.cols = { | 407 e.disposition = disp |
| 357 {value = textured}, | 408 break |
| 358 {value = pdisplay}, | |
| 359 {} | |
| 360 } | |
| 361 -- This is horrible. Must do better. | |
| 362 if e.extratext then | |
| 363 for disp,text in self:_iter_dispositions('from_notes_text') do | |
| 364 if text == e.extratext then | |
| 365 e.disposition = disp | |
| 366 break | |
| 367 end | |
| 368 end | 409 end |
| 369 end | 410 end |
| 370 local ex = eoi_st_lootrow_col3_colortable[e.disposition].text | 411 end |
| 371 if e.bcast_from and display_bcast_from and e.extratext then | 412 local ex = eoi_st_lootrow_col3_colortable[e.disposition].text |
| 372 ex = e.extratext .. " (from " .. e.bcast_from .. ")" | 413 if e.bcast_from and display_bcast_from and e.extratext then |
| 373 elseif e.bcast_from and display_bcast_from then | 414 ex = e.extratext .. " (from " .. e.bcast_from .. ")" |
| 374 ex = ex .. (e.disposition and " " or "") | 415 elseif e.bcast_from and display_bcast_from then |
| 375 .. "(from " .. e.bcast_from .. ")" | 416 ex = ex .. (e.disposition and " " or "") |
| 376 elseif e.extratext then | 417 .. "(from " .. e.bcast_from .. ")" |
| 377 ex = e.extratext | 418 elseif e.extratext then |
| 419 ex = e.extratext | |
| 420 end | |
| 421 e.cols[3].value = ex | |
| 422 | |
| 423 elseif e.kind == 'boss' then | |
| 424 local v | |
| 425 e.duration = e.duration or 0 -- can occasionally miss getting set | |
| 426 if e.reason == 'kill' then | |
| 427 if e.attempts == 1 then | |
| 428 v = "one-shot" | |
| 429 else | |
| 430 v = ("kill on %d%s attempt"):format(e.attempts or 0, | |
| 431 e.attempts==2 and "nd" or e.attempts==3 and "rd" or "th") | |
| 378 end | 432 end |
| 379 e.cols[3].value = ex | 433 v = ("%s (%d:%.2d)"):format(v, math.floor(e.duration/60), math.floor(e.duration%60)) |
| 380 | 434 elseif e.reason == 'wipe' then |
| 381 elseif e.kind == 'boss' then | 435 v = ("wipe (%d:%.2d)"):format(math.floor(e.duration/60), math.floor(e.duration%60)) |
| 382 local v | |
| 383 e.duration = e.duration or 0 -- can occasionally miss getting set | |
| 384 if e.reason == 'kill' then | |
| 385 if e.attempts == 1 then | |
| 386 v = "one-shot" | |
| 387 else | |
| 388 v = ("kill on %d%s attempt"):format(e.attempts or 0, | |
| 389 e.attempts==2 and "nd" or e.attempts==3 and "rd" or "th") | |
| 390 end | |
| 391 v = ("%s (%d:%.2d)"):format(v, math.floor(e.duration/60), math.floor(e.duration%60)) | |
| 392 elseif e.reason == 'wipe' then | |
| 393 v = ("wipe (%d:%.2d)"):format(math.floor(e.duration/60), math.floor(e.duration%60)) | |
| 394 end | |
| 395 e.cols = { | |
| 396 {value = e.bossname}, | |
| 397 {value = e.instance}, | |
| 398 {value = v or ""}, | |
| 399 } | |
| 400 | |
| 401 elseif e.kind == 'time' then | |
| 402 e.cols = setmetatable({ | |
| 403 {value=e.startday.text}, | |
| 404 }, time_column1_used_mt) | |
| 405 --[[e.cols = { | |
| 406 {value=e.startday.text}, | |
| 407 {value=""}, | |
| 408 {value=""}, | |
| 409 }]] | |
| 410 | |
| 411 end | 436 end |
| 412 end | 437 e.cols[1].value = e.bossname |
| 413 self.loot_clean = #g_loot | 438 e.cols[2].value = e.instance |
| 414 end | 439 e.cols[3].value = v or "" |
| 440 | |
| 441 elseif e.kind == 'time' then | |
| 442 e.cols[1].value = e.startday.text | |
| 443 e.cols[2].value = "" | |
| 444 e.cols[3].value = "" | |
| 445 | |
| 446 end | |
| 447 break | |
| 448 end end | |
| 449 self.loot_clean = #g_loot | |
| 415 end | 450 end |
| 416 | 451 |
| 417 do | 452 do |
| 418 function addon:_fill_out_hist_data (opt_starting_index) | 453 function addon:_fill_out_hist_data (opt_starting_index) |
| 419 local new, del = flib.new, flib.del | 454 local new, del = flib.new, flib.del |
| 801 | 836 |
| 802 -- Done at startup, and whenever we've changed the population of tabs. | 837 -- Done at startup, and whenever we've changed the population of tabs. |
| 803 function addon:gui_init (loot_pointer, uniques_pointer) | 838 function addon:gui_init (loot_pointer, uniques_pointer) |
| 804 g_loot = assert(loot_pointer, "something went wrong at startup") | 839 g_loot = assert(loot_pointer, "something went wrong at startup") |
| 805 g_uniques = assert(uniques_pointer, "something went wrong at startup") | 840 g_uniques = assert(uniques_pointer, "something went wrong at startup") |
| 841 g_dloot = do_g_loot_wrap(g_loot) | |
| 806 g_generated = nil | 842 g_generated = nil |
| 807 tabgroup_tabs = {} | 843 tabgroup_tabs = {} |
| 808 window_title = "Ouro Loot " .. self.version | 844 window_title = "Ouro Loot " .. self.version |
| 809 -- TabGroup stretches out the tabs to fill the row but only if >75% of the | 845 -- TabGroup stretches out the tabs to fill the row but only if >75% of the |
| 810 -- row is already full. It turns out that not doing this looks like ass. | 846 -- row is already full. It turns out that not doing this looks like ass. |
| 821 if not tabs_OnGroupSelected[name] then | 857 if not tabs_OnGroupSelected[name] then |
| 822 tabs_OnGroupSelected[name] = tabs_generated_text_OGS | 858 tabs_OnGroupSelected[name] = tabs_generated_text_OGS |
| 823 end | 859 end |
| 824 end | 860 end |
| 825 dirty_tabs = nil | 861 dirty_tabs = nil |
| 862 return g_dloot | |
| 826 end | 863 end |
| 827 | 864 |
| 828 --[[ | 865 --[[ |
| 829 Dropdown menu handling; this has grown in ungainly directions. | 866 Dropdown menu handling; this has grown in ungainly directions. |
| 830 ]] | 867 ]] |
| 887 dialog.editBox:SetScript("OnTextChanged",StaticPopup_EditBoxOnTextChanged) | 924 dialog.editBox:SetScript("OnTextChanged",StaticPopup_EditBoxOnTextChanged) |
| 888 dialog.data = {rowindex=rowi, display=_d, kind=text} | 925 dialog.data = {rowindex=rowi, display=_d, kind=text} |
| 889 end, | 926 end, |
| 890 | 927 |
| 891 df_DELETE = function(rowi) | 928 df_DELETE = function(rowi) |
| 892 local gone = tremove (g_loot, rowi) | 929 local dgone, gone = g_dloot:remove(rowi) |
| 893 addon:Fire ('DelEOIEntry', gone) | 930 addon:Fire ('DelEOIEntry', gone) |
| 894 addon:Print("Removed %s.", | 931 addon:Print("Removed %s.", |
| 895 gone.itemlink or gone.bossname or gone.startday.text) | 932 gone.itemlink or gone.bossname or gone.startday.text) |
| 896 if gone.kind == 'loot' then | 933 if gone.kind == 'loot' then |
| 897 addon:Fire ('DelLootEntry', gone) | 934 addon:Fire ('DelLootEntry', gone) |
| 912 end, | 949 end, |
| 913 | 950 |
| 914 ["Delete remaining entries for this day"] = function(rowi,kind) | 951 ["Delete remaining entries for this day"] = function(rowi,kind) |
| 915 -- if kind is boss, also need to stop at new timestamp | 952 -- if kind is boss, also need to stop at new timestamp |
| 916 local fencepost = addon._find_timeboss_fencepost (kind, rowi) | 953 local fencepost = addon._find_timeboss_fencepost (kind, rowi) |
| 917 local count = fencepost and (fencepost-rowi) or (#g_loot-rowi+1) | 954 local count = fencepost and (fencepost-rowi) or (#g_dloot-rowi+1) |
| 918 repeat | 955 repeat |
| 919 eoi_dropdownfuncs.df_DELETE(rowi) | 956 eoi_dropdownfuncs.df_DELETE(rowi) |
| 920 count = count - 1 | 957 count = count - 1 |
| 921 until count < 1 | 958 until count < 1 |
| 922 end, | 959 end, |
| 923 | 960 |
| 924 ["Rebroadcast this loot entry"] = function(rowi) | 961 ["Rebroadcast this loot entry"] = function(rowi) |
| 925 local e = g_loot[rowi] | 962 local e = g_dloot[rowi] |
| 926 -- This only works because GetItemInfo accepts multiple argument formats | 963 -- This only works because GetItemInfo accepts multiple argument formats |
| 927 addon:vbroadcast('loot', e.person, e.unique, e.itemlink, e.count, e.cols[3].value) | 964 addon:vbroadcast('loot', e.person, e.unique, e.itemlink, e.count, e.cols[3].value) |
| 928 addon:Print("Rebroadcast entry", rowi, e.itemlink) | 965 addon:Print("Rebroadcast entry", rowi, e.itemlink) |
| 929 end, | 966 end, |
| 930 | 967 |
| 931 ["Rebroadcast this boss"] = function(rowi,kind) | 968 ["Rebroadcast this boss"] = function(rowi,kind) |
| 932 -- if kind is boss, also need to stop at new timestamp | 969 -- if kind is boss, also need to stop at new timestamp |
| 933 local fencepost = addon._find_timeboss_fencepost (kind, rowi) or #g_loot | 970 local fencepost = addon._find_timeboss_fencepost (kind, rowi) or #g_dloot |
| 934 -- this could be a lot of traffic, but frankly it's counterproductive | 971 -- this could be a lot of traffic, but frankly it's counterproductive |
| 935 -- to try to micromanage when ChatThrottleLib is already doing so | 972 -- to try to micromanage when ChatThrottleLib is already doing so |
| 936 repeat | 973 repeat |
| 937 local e = g_loot[rowi] | 974 local e = g_dloot[rowi] |
| 938 if e.kind == 'boss' then | 975 if e.kind == 'boss' then |
| 939 addon:vbroadcast('boss', e.reason, e.bossname, e.instance) | 976 addon:vbroadcast('boss', e.reason, e.bossname, e.instance) |
| 940 elseif e.kind == 'loot' then | 977 elseif e.kind == 'loot' then |
| 941 -- This only works because GetItemInfo accepts multiple argument formats | 978 -- This only works because GetItemInfo accepts multiple argument formats |
| 942 addon:vbroadcast('loot', e.person, e.unique, e.itemlink, e.count, e.cols[3].value) | 979 addon:vbroadcast('loot', e.person, e.unique, e.itemlink, e.count, e.cols[3].value) |
| 1203 | 1240 |
| 1204 return true -- do not do anything further | 1241 return true -- do not do anything further |
| 1205 end | 1242 end |
| 1206 | 1243 |
| 1207 function eoi_editcell (row_index, cell_frame) | 1244 function eoi_editcell (row_index, cell_frame) |
| 1208 local e = g_loot[row_index] | 1245 local e = g_dloot[row_index] |
| 1209 if not e then return end -- how the hell could we get this far? | 1246 if not e then return end -- how the hell could we get this far? |
| 1210 local celldata = e.cols[3] | 1247 local celldata = e.cols[3] |
| 1211 local box = AceGUI:Create("EditBox") | 1248 local box = AceGUI:Create("EditBox") |
| 1212 box:SetText(celldata.value) | 1249 box:SetText(celldata.value) |
| 1213 box:SetUserData("old show", box.editbox:GetScript("OnShow")) | 1250 box:SetUserData("old show", box.editbox:GetScript("OnShow")) |
| 1327 else | 1364 else |
| 1328 stable:SetHighLightColor (rowFrame, stable:GetDefaultHighlight()) | 1365 stable:SetHighLightColor (rowFrame, stable:GetDefaultHighlight()) |
| 1329 end | 1366 end |
| 1330 end | 1367 end |
| 1331 | 1368 |
| 1332 local eoi_st_cols = { | 1369 eoi_st_cols = { |
| 1333 { -- col 1 | 1370 { -- col 1 |
| 1334 name = "Item", | 1371 name = "Item", |
| 1335 width = 250, | 1372 width = 250, |
| 1336 }, | 1373 }, |
| 1337 { -- col 2 | 1374 { -- col 2 |
| 1379 | 1416 |
| 1380 -- Calling SetData breaks (trying to call Refresh) if g_loot hasn't gone | 1417 -- Calling SetData breaks (trying to call Refresh) if g_loot hasn't gone |
| 1381 -- through this loop. | 1418 -- through this loop. |
| 1382 addon:_fill_out_eoi_data(1) | 1419 addon:_fill_out_eoi_data(1) |
| 1383 -- safety check begin | 1420 -- safety check begin |
| 1384 for i,e in ipairs(g_loot) do | 1421 for i,e in ipairs(g_dloot) do |
| 1385 if type(e.cols) ~= 'table' then | 1422 if type(e.cols) ~= 'table' then |
| 1386 addon:Print("ARGH, index",i,"bad in eoi_OGS, type",type(e.cols), | 1423 addon:Print("ARGH, index",i,"bad in eoi_OGS, type",type(e.cols), |
| 1387 "entry kind", e.kind, "data", e.itemname or e.bossname or e.startday.text, | 1424 "entry kind", e.kind, "data", e.itemname or e.bossname or e.startday.text, |
| 1388 "-- please take a screenshot and send to Farmbuyer@US-Kilrogg.") | 1425 "-- please take a screenshot and send to Farmbuyer@US-Kilrogg.") |
| 1389 tabledump(e) | 1426 tabledump(e) |
| 1390 end | 1427 end |
| 1391 end | 1428 end |
| 1392 -- safety check end | 1429 -- safety check end |
| 1393 ST:SetData(g_loot) | 1430 ST:SetData(g_dloot) |
| 1394 ST:EnableSelection(true) | 1431 ST:EnableSelection(true) |
| 1395 ST:RegisterEvents{ | 1432 ST:RegisterEvents{ |
| 1396 OnEnter = eoi_st_OnEnter, | 1433 OnEnter = eoi_st_OnEnter, |
| 1397 OnLeave = eoi_st_OnLeave, | 1434 OnLeave = eoi_st_OnLeave, |
| 1398 OnClick = eoi_st_OnClick, | 1435 OnClick = eoi_st_OnClick, |
| 1409 return oldrefresh(self) | 1446 return oldrefresh(self) |
| 1410 end | 1447 end |
| 1411 ST.OuroLoot_Refresh = function (self, opt_index) | 1448 ST.OuroLoot_Refresh = function (self, opt_index) |
| 1412 addon:_fill_out_eoi_data(opt_index) | 1449 addon:_fill_out_eoi_data(opt_index) |
| 1413 -- safety check begin | 1450 -- safety check begin |
| 1414 for i,e in ipairs(g_loot) do | 1451 for i,e in ipairs(g_dloot) do |
| 1415 if type(e.cols) ~= 'table' then | 1452 if type(e.cols) ~= 'table' then |
| 1416 addon:Print("ARGH, index",i,"bad in eoi refresh, refreshed at", opt_index, "type",type(e.cols), | 1453 addon:Print("ARGH, index",i,"bad in eoi refresh, refreshed at", opt_index, "type",type(e.cols), |
| 1417 "entry kind", e.kind, "data", e.itemname or e.bossname or e.startday.text, | 1454 "entry kind", e.kind, "data", e.itemname or e.bossname or e.startday.text, |
| 1418 "-- please take a screenshot and send to Farmbuyer@US-Kilrogg.") | 1455 "-- please take a screenshot and send to Farmbuyer@US-Kilrogg.") |
| 1419 tabledump(e) | 1456 tabledump(e) |
| 1519 display from a chat link.]] | 1556 display from a chat link.]] |
| 1520 tabs_CLI_special["eoi"] = function (name_or_lineno) | 1557 tabs_CLI_special["eoi"] = function (name_or_lineno) |
| 1521 if type(name_or_lineno) == 'string' then | 1558 if type(name_or_lineno) == 'string' then |
| 1522 -- uh | 1559 -- uh |
| 1523 elseif type(name_or_lineno) == 'number' then | 1560 elseif type(name_or_lineno) == 'number' then |
| 1524 if name_or_lineno < 1 or name_or_lineno > #g_loot then | 1561 if name_or_lineno < 1 or name_or_lineno > #g_dloot then |
| 1525 return | 1562 return |
| 1526 end | 1563 end |
| 1527 local scrollhere = -9 | 1564 local scrollhere = -9 |
| 1528 repeat | 1565 repeat |
| 1529 scrollhere = scrollhere + 10 | 1566 scrollhere = scrollhere + 10 |
| 2483 -- dropdown. Thanks to noCancelOnReuse, each Show done here will technically | 2520 -- dropdown. Thanks to noCancelOnReuse, each Show done here will technically |
| 2484 -- Hide and redisplay the same dialog, passing along the same 'data' structure | 2521 -- Hide and redisplay the same dialog, passing along the same 'data' structure |
| 2485 -- each time. The topmost call to our OnAccept will then finish by hiding the | 2522 -- each time. The topmost call to our OnAccept will then finish by hiding the |
| 2486 -- (very last) dialog. | 2523 -- (very last) dialog. |
| 2487 -- | 2524 -- |
| 2488 -- This is really, really hideous to read. | 2525 -- This is really, really hideous to read. Maybe increment a 'stage' counter |
| 2526 -- so the code flows top-down, rather than testing for missing data and going | |
| 2527 -- backwards. | |
| 2489 local function eoi_st_insert_OnAccept_boss (dialog, data, data2) | 2528 local function eoi_st_insert_OnAccept_boss (dialog, data, data2) |
| 2490 if data.all_done then | 2529 if data.all_done then |
| 2491 -- It'll probably be the final entry in the table, but there might have | 2530 -- boss_index will probably be the final entry in the table, but there |
| 2492 -- been real loot happening while the user was clicking and typing. | 2531 -- might have been real loot happening while the user was typing. |
| 2493 local boss_index = addon._addBossEntry{ | 2532 local boss_index = addon._addBossEntry{ |
| 2494 kind = 'boss', | 2533 kind = 'boss', |
| 2495 bossname = (gui.opts.snarky_boss and addon.boss_abbrev[data.name] or data.name) or data.name, | 2534 bossname = (gui.opts.snarky_boss and addon.boss_abbrev[data.name] or data.name) or data.name, |
| 2496 reason = 'kill', | 2535 reason = 'kill', |
| 2497 instance = data.instance, | 2536 instance = data.instance, |
