From 0c14f044107335e5dae7bf514ec9bfc6d36a7848 Mon Sep 17 00:00:00 2001 From: Jessica Wyatt Date: Thu, 11 Sep 2025 19:50:34 +0100 Subject: [PATCH] Sort wishlist items by dungeon Wishlist items now grouped together by the the dungeon they drop in. Extra info line used to show the specific boss that drops the item. --- Core/AtlasLoot.lua | 16 ++++++++++++++++ Core/WishList.lua | 17 ++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/Core/AtlasLoot.lua b/Core/AtlasLoot.lua index 08c0626..bfdbc3d 100644 --- a/Core/AtlasLoot.lua +++ b/Core/AtlasLoot.lua @@ -1320,7 +1320,23 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame) end end end + + if wishDataSource == "AtlasLootItems" then + -- Set boss + if wishDataID and AtlasLoot_IsLootTableAvailable(wishDataID) then + for _, v in ipairs(AtlasLoot_Data[wishDataSource][wishDataID]) do + if dataSource[dataID][i][1] == v[1] then + local boss = AtlasLoot_GetWishListSubheadingBoss(wishDataID) + + if boss then + extraFrame:SetText(extra .. " - "..boss) + end + end + end + end + end end + --For convenience, we store information about the objects in the objects so that it can be easily accessed later itemButton.itemID = dataSource[dataID][i][1]; itemButton.itemIDName = dataSource[dataID][i][3]; diff --git a/Core/WishList.lua b/Core/WishList.lua index 44bd452..11aebb2 100644 --- a/Core/WishList.lua +++ b/Core/WishList.lua @@ -214,6 +214,21 @@ function GetLootTableParent(dataID) return parentID; end +local function GetWishListSubheadingDungeon(dataID) + if not AtlasLoot_TableNames then return end + local zoneID ; + for i, v in pairs(AtlasLoot_TableNamesBoss) do + for j,k in pairs(v) do + if dataID == j then + zoneID = i + break; + end + end + end + + return zoneID; +end + --[[ AtlasLoot_CategorizeWishList(wlTable): Group items with zone/event name etc, and format them by adding subheadings and empty lines @@ -228,7 +243,7 @@ function AtlasLoot_CategorizeWishList(wlTable) local _, _, dataID = strfind(v[5], "^(.+)|.+"); -- Build subheading table if not subheadings[dataID] then - subheadings[dataID] = AtlasLoot_GetWishListSubheadingBoss(dataID); + subheadings[dataID] = GetWishListSubheadingDungeon(dataID); -- AtlasLoot_GetWishListSubheadingBoss(dataID); -- If search failed, replace ID like "Aldor2" to "Aldor1" and try again if not subheadings[dataID] and string.find(dataID, "^%a+%d?$") then subheadings[dataID] = AtlasLoot_GetWishListSubheading(string.sub(dataID, 1, string.len(dataID) - 1).."1");