expansion menu now swaps current table

This commit is contained in:
Anch
2022-08-12 16:16:34 +12:00
parent a7bc69e802
commit 5012902cd0
4 changed files with 39 additions and 9 deletions
+16
View File
@@ -715,6 +715,7 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource, tablenum)
if dataID ~= "WishList" and dataID ~= "FilterList" and dataSource[dataID].Back ~= true then
AtlasLootItemsFrame.refreshOri = {dataID, dataSource, tablenum};
AtlasLoot.db.profile.LastBoss = {dataID, dataSource, tablenum, ATLASLOOT_LASTMODULE, ATLASLOOT_CURRENTTABLE};
AtlasLoot.db.profile[ATLASLOOT_CURRENTTABLE] = {dataID, dataSource, tablenum, ATLASLOOT_LASTMODULE, ATLASLOOT_CURRENTTABLE};
end
--This is a valid QuickLook, so show the UI objects
@@ -777,6 +778,21 @@ Called when <-, -> are pressed and calls up the appropriate loot page
]]
function AtlasLoot:NavButton_OnClick(self)
local tablenum, dataID, dataSource = self.tablenum, self.tablebase[1], self.tablebase[2];
if #dataSource[dataID] > 26 then
local offset = math.floor(AtlasLootDefaultFrameSubTableScrollScrollBar:GetValue());
local min, max = AtlasLootDefaultFrameSubTableScrollScrollBar:GetMinMaxValues();
if self == AtlasLootItemsFrame_NEXT then
AtlasLootDefaultFrameSubTableScrollScrollBar:SetValue(offset * math.floor((max / #dataSource[dataID])));
--AtlasLootDefaultFrameSubTableScrollScrollBarScrollDownButton:Click()
elseif self == AtlasLootItemsFrame_PREV then
AtlasLootDefaultFrameSubTableScrollScrollBar:SetValue(offset * math.floor((max / #dataSource[dataID])));
--AtlasLootDefaultFrameSubTableScrollScrollBarScrollUpButton:Click()
end
AtlasLootDefaultFrameSubTableScroll.offset = math.floor(offset / 16.5)
--AtlasLoot:SubTableScrollFrameUpdate(dataID, dataSource, tablenum);
end
AtlasLoot:ShowItemsFrame(dataID, dataSource, tablenum);
end
@@ -80,7 +80,12 @@ function AtlasLoot:DewDropClick(tablename, text, tablenum)
AtlasLoot:IsLootTableAvailable(AtlasLoot_SubMenus[tablename].Module);
AtlasLoot_DewdropSubMenu:Unregister(AtlasLootDefaultFrame_SubMenu);
AtlasLoot:DewdropSubMenuRegister(AtlasLoot_SubMenus[tablename]);
AtlasLoot:DewDropSubMenuClick(AtlasLoot_SubMenus[tablename][tablenum][2])
local lasttable = AtlasLoot.db.profile[ATLASLOOT_CURRENTTABLE];
if lasttable then
AtlasLoot:ShowItemsFrame(lasttable[1], lasttable[2], lasttable[3]);
else
AtlasLoot:DewDropSubMenuClick(AtlasLoot_SubMenus[tablename][tablenum][2])
end
AtlasLoot_Dewdrop:Close(1);
end
@@ -109,11 +114,20 @@ function AtlasLoot:DewdropExpansionMenuClick(expansion, name)
AtlasLoot_DewdropExpansionMenu:Close(1);
AtlasLoot_Expac = expansion;
if ATLASLOOT_CURRENTTABLE then
local tablename = AtlasLoot:CleandataID(ATLASLOOT_CURRENTTABLE, 1) .. AtlasLoot_Expac;
AtlasLoot:IsLootTableAvailable(AtlasLoot_SubMenus[tablename].Module);
AtlasLoot_DewdropSubMenu:Unregister(AtlasLootDefaultFrame_SubMenu);
AtlasLoot:DewdropSubMenuRegister(AtlasLoot_SubMenus[tablename]);
ATLASLOOT_CURRENTTABLE = AtlasLoot:CleandataID(ATLASLOOT_CURRENTTABLE, 1) .. AtlasLoot_Expac;
AtlasLoot:IsLootTableAvailable(AtlasLoot_SubMenus[ATLASLOOT_CURRENTTABLE].Module);
local tablename = AtlasLoot_SubMenus[ATLASLOOT_CURRENTTABLE][1][2];
local lasttable = AtlasLoot.db.profile[ATLASLOOT_CURRENTTABLE];
AtlasLoot_DewdropSubMenu:Unregister(AtlasLootDefaultFrame_SubMenu);
AtlasLoot:DewdropSubMenuRegister(AtlasLoot_SubMenus[ATLASLOOT_CURRENTTABLE]);
if lasttable then
AtlasLoot:ShowItemsFrame(lasttable[1], lasttable[2], lasttable[3]);
else
local tablenum = AtlasLoot_Data[tablename].Loadfirst or 1;
AtlasLoot:ShowItemsFrame(tablename, AtlasLoot_Data, tablenum);
end
end
end
--[[
+3 -3
View File
@@ -7,7 +7,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
--Dungeon and Raid Menus
AtlasLoot_SubMenus["Dungeons and Raids CLASSIC"] = {
AtlasLoot_SubMenus["Dungeons and RaidsCLASSIC"] = {
Module = "AtlasLootOriginalWoW";
{"Raids:", "OldKeys", "Header"};
{"", "MoltenCore"};
@@ -42,7 +42,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
{"", "ZulFarrak"};
};
AtlasLoot_SubMenus["Dungeons and Raids TBC"] = {
AtlasLoot_SubMenus["Dungeons and RaidsTBC"] = {
Module = "AtlasLootBurningCrusade";
{"Raids:", "BCKeys", "Header"};
{"", "Karazhan"};
@@ -74,7 +74,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0");
{"", "MagistersTerrace"};
};
AtlasLoot_SubMenus["Dungeons and Raids WRATH"] = {
AtlasLoot_SubMenus["Dungeons and RaidsWRATH"] = {
Module = "AtlasLootWotLK";
{"Raids:", "WrathKeys", "Header"};
{"", "Naxxramas80"};
+1 -1
View File
@@ -13,7 +13,7 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0")
--This is a multi-layer table defining the main loot listing.
--Entries have the text to display, loot table or sub table to link to and if the link is to a loot table or sub table
AtlasLoot_Modules = {
{AL["Dungeons and Raids"], "Dungeons and Raids ", 2};
{AL["Dungeons and Raids"], "Dungeons and Raids", 2};
{AL["Crafting"], "Crafting"};
{AL["Sets/Collections"], "Collections"};
{AL["PvP Rewards"], "PVP"};