diff --git a/Core/AtlasLoot.lua b/Core/AtlasLoot.lua
index 08c0626..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.
@@ -1320,7 +1337,23 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
end
end
end
+
+ 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
+ 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/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 44bd452..93b91e4 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,11 @@ function AtlasLoot_CategorizeWishList(wlTable)
local _, _, dataID = strfind(v[5], "^(.+)|.+");
-- Build subheading table
if not subheadings[dataID] then
- subheadings[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");