From 01853a4d73f128258e61d373ac387db0a5b9822a Mon Sep 17 00:00:00 2001 From: Anch Date: Sun, 20 Mar 2022 22:10:46 +1300 Subject: [PATCH] untied back button from rest of the nav buttons --- AtlasLoot/Core/AtlasLoot.lua | 21 ++++++++++++++++++++- AtlasLoot/Core/AtlasLoot.xml | 4 ++-- AtlasLoot/Locales/constants.en.lua | 1 + 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/AtlasLoot/Core/AtlasLoot.lua b/AtlasLoot/Core/AtlasLoot.lua index e665885..17a1138 100644 --- a/AtlasLoot/Core/AtlasLoot.lua +++ b/AtlasLoot/Core/AtlasLoot.lua @@ -1149,9 +1149,28 @@ end --[[ AtlasLoot_NavButton_OnClick: -Called when <-, -> or 'Back' are pressed and calls up the appropriate loot page +Called when <-, -> are pressed and calls up the appropriate loot page ]] function AtlasLoot_NavButton_OnClick() + if AtlasLootItemsFrame.refresh and AtlasLootItemsFrame.refresh[4] then + if strsub(this.lootpage, 1, 16) == "SearchResultPage" then + AtlasLoot_ShowItemsFrame("SearchResult", this.lootpage, (AL["Search Result: %s"]):format(AtlasLootCharDB.LastSearchedText or ""), AtlasLootItemsFrame.refresh[4]); + elseif strsub(this.lootpage, 1, 12) == "WishListPage" then + AtlasLoot_ShowItemsFrame("WishList", this.lootpage, AL["Wishlist"], AtlasLootItemsFrame.refresh[4]); + else + AtlasLoot_ShowItemsFrame(this.lootpage, AtlasLootItemsFrame.refresh[2], "", AtlasLootItemsFrame.refresh[4]); + end + else + --Fallback for if the requested loot page is a menu and does not have a .refresh instance + AtlasLoot_ShowItemsFrame(this.lootpage, "", "", AtlasFrame); + end +end + +--[[ +AtlasLoot_NavButton_OnClick: +Called when 'Back'Button is pressed and calls up the appropriate loot page +]] +function AtlasLoot_BackButton_OnClick() if AtlasLootItemsFrame.refresh and AtlasLootItemsFrame.refresh[4] then if strsub(this.lootpage, 1, 16) == "SearchResultPage" then AtlasLoot_ShowItemsFrame("SearchResult", this.lootpage, (AL["Search Result: %s"]):format(AtlasLootCharDB.LastSearchedText or ""), AtlasLootItemsFrame.refresh[4]); diff --git a/AtlasLoot/Core/AtlasLoot.xml b/AtlasLoot/Core/AtlasLoot.xml index c860487..35b0b41 100644 --- a/AtlasLoot/Core/AtlasLoot.xml +++ b/AtlasLoot/Core/AtlasLoot.xml @@ -166,7 +166,7 @@