From 8491f38e6e92e2ded2b8344ab4015e32841fdc5d Mon Sep 17 00:00:00 2001 From: Jessica Wyatt Date: Fri, 12 Sep 2025 01:04:58 +0100 Subject: [PATCH] Configurable wishlist layout --- Core/AtlasLoot.lua | 19 ++++++++++++++++++- Core/AtlasLoot.xml | 24 +++++++++++++++++++++--- Core/WishList.lua | 6 +++++- 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/Core/AtlasLoot.lua b/Core/AtlasLoot.lua index bfdbc3d..0ad6b85 100644 --- a/Core/AtlasLoot.lua +++ b/Core/AtlasLoot.lua @@ -341,6 +341,7 @@ function AtlasLootOptions_Init() AtlasLootOptionsFrameLootlinkTT:SetChecked(AtlasLootCharDB.LootlinkTT); AtlasLootOptionsFrameItemSyncTT:SetChecked(AtlasLootCharDB.ItemSyncTT); AtlasLootOptionsFrameShowSource:SetChecked(AtlasLootCharDB.ShowSource); + AtlasLootOptionsFrameWishlistGroupedByDungeon:SetChecked(AtlasLootCharDB.WishlistGroupedByDungeon); AtlasLootOptionsFrameEquipCompare:SetChecked(AtlasLootCharDB.EquipCompare); AtlasLootOptionsFrameOpaque:SetChecked(AtlasLootCharDB.Opaque); AtlasLootOptionsFrameItemID:SetChecked(AtlasLootCharDB.ItemIDs); @@ -369,6 +370,7 @@ function AtlasLootOptions_Fresh() AtlasLootCharDB.LootlinkTT = false; AtlasLootCharDB.ItemSyncTT = false; AtlasLootCharDB.ShowSource = true; + AtlasLootCharDB.WishlistGroupedByDungeon = true; AtlasLootCharDB.EquipCompare = false; AtlasLootCharDB.Opaque = false; AtlasLootCharDB.ItemIDs = false; @@ -880,6 +882,21 @@ function AtlasLootOptions_ShowSourceToggle() AtlasLootOptions_Init(); end +function AtlasLootOptions_WishlistGroupedByDungeonToggle() + if(AtlasLootCharDB.WishlistGroupedByDungeon) then + AtlasLootCharDB.WishlistGroupedByDungeon = false; + else + AtlasLootCharDB.WishlistGroupedByDungeon = true; + end + AtlasLootOptions_Init(); + AtlasLoot_WishList = AtlasLoot_CategorizeWishList(AtlasLootCharDB["WishList"]); + local dataID = AtlasLootItemsFrame.refresh[1]; + + if (dataID == 'WishList') then + AtlasLoot_ShowWishList(); + end +end + --[[ AtlasLootOptions_EquipCompareToggle: Toggles EquipCompare. Adds a tooltip with the equipped item (if it's the case) next to the default one. @@ -1321,7 +1338,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame) end end - if wishDataSource == "AtlasLootItems" then + if wishDataSource == "AtlasLootItems" and AtlasLootCharDB.WishlistGroupedByDungeon then -- Set boss if wishDataID and AtlasLoot_IsLootTableAvailable(wishDataID) then for _, v in ipairs(AtlasLoot_Data[wishDataSource][wishDataID]) do diff --git a/Core/AtlasLoot.xml b/Core/AtlasLoot.xml index 4326c4f..8387d20 100644 --- a/Core/AtlasLoot.xml +++ b/Core/AtlasLoot.xml @@ -1366,7 +1366,7 @@ - + @@ -1516,7 +1516,7 @@ - + @@ -1524,6 +1524,24 @@ + + + local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot"); + getglobal(this:GetName().."Text"):SetText("Group wishlist by dungeon"); + + + AtlasLootOptions_WishlistGroupedByDungeonToggle(); + + + + + + + + + + + local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot"); @@ -1538,7 +1556,7 @@ - + diff --git a/Core/WishList.lua b/Core/WishList.lua index 11aebb2..93b91e4 100644 --- a/Core/WishList.lua +++ b/Core/WishList.lua @@ -243,7 +243,11 @@ function AtlasLoot_CategorizeWishList(wlTable) local _, _, dataID = strfind(v[5], "^(.+)|.+"); -- Build subheading table if not subheadings[dataID] then - subheadings[dataID] = GetWishListSubheadingDungeon(dataID); -- AtlasLoot_GetWishListSubheadingBoss(dataID); + if AtlasLootCharDB.WishlistGroupedByDungeon then + subheadings[dataID] = GetWishListSubheadingDungeon(dataID); + else + subheadings[dataID] = AtlasLoot_GetWishListSubheadingBoss(dataID); + end -- 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");