Configurable wishlist layout

This commit is contained in:
Jessica Wyatt
2025-09-12 01:04:58 +01:00
parent 0c14f04410
commit 8491f38e6e
3 changed files with 44 additions and 5 deletions
+18 -1
View File
@@ -341,6 +341,7 @@ function AtlasLootOptions_Init()
AtlasLootOptionsFrameLootlinkTT:SetChecked(AtlasLootCharDB.LootlinkTT); AtlasLootOptionsFrameLootlinkTT:SetChecked(AtlasLootCharDB.LootlinkTT);
AtlasLootOptionsFrameItemSyncTT:SetChecked(AtlasLootCharDB.ItemSyncTT); AtlasLootOptionsFrameItemSyncTT:SetChecked(AtlasLootCharDB.ItemSyncTT);
AtlasLootOptionsFrameShowSource:SetChecked(AtlasLootCharDB.ShowSource); AtlasLootOptionsFrameShowSource:SetChecked(AtlasLootCharDB.ShowSource);
AtlasLootOptionsFrameWishlistGroupedByDungeon:SetChecked(AtlasLootCharDB.WishlistGroupedByDungeon);
AtlasLootOptionsFrameEquipCompare:SetChecked(AtlasLootCharDB.EquipCompare); AtlasLootOptionsFrameEquipCompare:SetChecked(AtlasLootCharDB.EquipCompare);
AtlasLootOptionsFrameOpaque:SetChecked(AtlasLootCharDB.Opaque); AtlasLootOptionsFrameOpaque:SetChecked(AtlasLootCharDB.Opaque);
AtlasLootOptionsFrameItemID:SetChecked(AtlasLootCharDB.ItemIDs); AtlasLootOptionsFrameItemID:SetChecked(AtlasLootCharDB.ItemIDs);
@@ -369,6 +370,7 @@ function AtlasLootOptions_Fresh()
AtlasLootCharDB.LootlinkTT = false; AtlasLootCharDB.LootlinkTT = false;
AtlasLootCharDB.ItemSyncTT = false; AtlasLootCharDB.ItemSyncTT = false;
AtlasLootCharDB.ShowSource = true; AtlasLootCharDB.ShowSource = true;
AtlasLootCharDB.WishlistGroupedByDungeon = true;
AtlasLootCharDB.EquipCompare = false; AtlasLootCharDB.EquipCompare = false;
AtlasLootCharDB.Opaque = false; AtlasLootCharDB.Opaque = false;
AtlasLootCharDB.ItemIDs = false; AtlasLootCharDB.ItemIDs = false;
@@ -880,6 +882,21 @@ function AtlasLootOptions_ShowSourceToggle()
AtlasLootOptions_Init(); AtlasLootOptions_Init();
end 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: AtlasLootOptions_EquipCompareToggle:
Toggles EquipCompare. Adds a tooltip with the equipped item (if it's the case) next to the default one. 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
end end
if wishDataSource == "AtlasLootItems" then if wishDataSource == "AtlasLootItems" and AtlasLootCharDB.WishlistGroupedByDungeon then
-- Set boss -- Set boss
if wishDataID and AtlasLoot_IsLootTableAvailable(wishDataID) then if wishDataID and AtlasLoot_IsLootTableAvailable(wishDataID) then
for _, v in ipairs(AtlasLoot_Data[wishDataSource][wishDataID]) do for _, v in ipairs(AtlasLoot_Data[wishDataSource][wishDataID]) do
+21 -3
View File
@@ -1366,7 +1366,7 @@
<Frame name="AtlasLootOptionsFrame" toplevel="true" frameStrata="DIALOG" movable="true" enableMouse="true" hidden="true" parent="UIParent" enableKeyboard="true"> <Frame name="AtlasLootOptionsFrame" toplevel="true" frameStrata="DIALOG" movable="true" enableMouse="true" hidden="true" parent="UIParent" enableKeyboard="true">
<Size> <Size>
<AbsDimension x="650" y="370"/> <AbsDimension x="650" y="400"/>
</Size> </Size>
<Anchors> <Anchors>
<Anchor point="CENTER"/> <Anchor point="CENTER"/>
@@ -1516,7 +1516,7 @@
</OnClick> </OnClick>
</Scripts> </Scripts>
</CheckButton> </CheckButton>
<CheckButton name="$parentEquipCompare" inherits="OptionsCheckButtonTemplate"> <CheckButton name="$parentWishlistGroupedByDungeon" inherits="OptionsCheckButtonTemplate">
<Anchors> <Anchors>
<Anchor point="TOPLEFT"> <Anchor point="TOPLEFT">
<Offset> <Offset>
@@ -1524,6 +1524,24 @@
</Offset> </Offset>
</Anchor> </Anchor>
</Anchors> </Anchors>
<Scripts>
<OnLoad>
local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot");
getglobal(this:GetName().."Text"):SetText("Group wishlist by dungeon");
</OnLoad>
<OnClick>
AtlasLootOptions_WishlistGroupedByDungeonToggle();
</OnClick>
</Scripts>
</CheckButton>
<CheckButton name="$parentEquipCompare" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="20" y="-280"/>
</Offset>
</Anchor>
</Anchors>
<Scripts> <Scripts>
<OnLoad> <OnLoad>
local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot"); local AL = AceLibrary("AceLocale-2.2"):new("AtlasLoot");
@@ -1538,7 +1556,7 @@
<Anchors> <Anchors>
<Anchor point="TOPLEFT"> <Anchor point="TOPLEFT">
<Offset> <Offset>
<AbsDimension x="20" y="-280"/> <AbsDimension x="20" y="-310"/>
</Offset> </Offset>
</Anchor> </Anchor>
</Anchors> </Anchors>
+5 -1
View File
@@ -243,7 +243,11 @@ function AtlasLoot_CategorizeWishList(wlTable)
local _, _, dataID = strfind(v[5], "^(.+)|.+"); local _, _, dataID = strfind(v[5], "^(.+)|.+");
-- Build subheading table -- Build subheading table
if not subheadings[dataID] then 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 search failed, replace ID like "Aldor2" to "Aldor1" and try again
if not subheadings[dataID] and string.find(dataID, "^%a+%d?$") then if not subheadings[dataID] and string.find(dataID, "^%a+%d?$") then
subheadings[dataID] = AtlasLoot_GetWishListSubheading(string.sub(dataID, 1, string.len(dataID) - 1).."1"); subheadings[dataID] = AtlasLoot_GetWishListSubheading(string.sub(dataID, 1, string.len(dataID) - 1).."1");