added experimental "reverse loot table" for faster lookups - wip

This commit is contained in:
telkar-rg
2023-11-04 10:13:22 +01:00
parent 2e3f0181c2
commit c603b9a30b
+27 -1
View File
@@ -9,8 +9,10 @@ local BI = LibStub("LibBabble-Inventory-3.0"):GetLookupTable()
local WHITE = "|cFFFFFFFF" local WHITE = "|cFFFFFFFF"
local GREEN = "|cFF00FF00" local GREEN = "|cFF00FF00"
local lootTable, lootTableRev
do
-- Simplified loot table containing item ID's only, based on AtlasLoot v5.09.00 -- Simplified loot table containing item ID's only, based on AtlasLoot v5.09.00
local lootTable = { lootTable = {
-- to do: HardModeArena & HardModeArena2 from sets_en.lua -- to do: HardModeArena & HardModeArena2 from sets_en.lua
-- to do : wotlk crafts -- to do : wotlk crafts
@@ -1639,6 +1641,30 @@ local lootTable = {
} }
lootTableRev = {}
local lastZone = {}
for zName, zTable in pairs(lootTable) do
for encounterName, encounterTable in pairs(zTable) do
for _, item_id in pairs(encounterTable) do
if not lootTableRev[item_id] then
lootTableRev[item_id] = format("%s, %s", zName, encounterName)
else
if lastZone[item_id] and lastZone[item_id] == zName then
lootTableRev[item_id] = format("%s/ %s", lootTableRev[item_id], encounterName)
else
lootTableRev[item_id] = format("%s; %s, %s", lootTableRev[item_id], zName, encounterName)
end
end
lastZone[item_id] = zName
end
end
end
DEBUG_HELP_TEST_1 = lootTableRev
end
local DataProviders local DataProviders
addon.Loots = {} addon.Loots = {}