diff --git a/AtlasLoot/Core/AtlasDifficulty.lua b/AtlasLoot/Core/AtlasDifficulty.lua index 794b991..5797b65 100644 --- a/AtlasLoot/Core/AtlasDifficulty.lua +++ b/AtlasLoot/Core/AtlasDifficulty.lua @@ -167,6 +167,10 @@ AtlasLoot_Difficulty = { }; + ["Search"] = {"Bloodforged", "Normal", "Heroic", "Mythic", "Mythic 1", "Mythic 2","Mythic 3","Mythic 4","Mythic 5", "Mythic 6","Mythic 7", + "Mythic 8","Mythic 9", "Mythic 10", "Mythic 11", "Mythic 12","Mythic 13","Mythic 14","Mythic 15", "Mythic 16","Mythic 17","Mythic 18", + "Mythic 19", "Mythic 20",}; + --Enums for comparisons in code Bloodforged = 1; Normal = 2; @@ -175,7 +179,8 @@ AtlasLoot_Difficulty = { MythicPlus = {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}; --Usage AtlasLoot_Difficulty.MythicPlus[1-20]; + DIF_SEARCH = 16; DUPLICATE = 17; MIN_DIF = 18; MAX_DIF = 19; -} \ No newline at end of file +} diff --git a/AtlasLoot/Core/AtlasLoot.lua b/AtlasLoot/Core/AtlasLoot.lua index 260c1dd..2b8aa7a 100644 --- a/AtlasLoot/Core/AtlasLoot.lua +++ b/AtlasLoot/Core/AtlasLoot.lua @@ -86,6 +86,9 @@ SelectedTable2TextSet = true isTablereference = false notPattern = false +--Search panel open and close save variables +--dataID, dataSource, boss, pFrame +SearchPrevData = {"", "", "", ""}; AtlasLootCharDB={}; @@ -506,6 +509,8 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame) local isItem; local spellName, spellIcon; + SearchPrevData = {dataID, dataSource, boss, pFrame}; + --If the loot table name has not been passed, throw up a debugging statement if dataID==nil then DEFAULT_CHAT_FRAME:AddMessage("No dataID!"); @@ -516,6 +521,9 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame) HideUIPanel(AtlasQuestInsideFrame); end + --Hide Advanced search if it is up + AtlasLootAdvancedSearch:Hide(); + --Ditch the Quicklook selector AtlasLoot_QuickLooks:Hide(); AtlasLootQuickLooksButton:Hide(); @@ -544,6 +552,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame) else dataSource = AtlasLoot_Data; end + if dataID == "FilterList" then Type = lastType; else @@ -621,6 +630,9 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame) if(toShow) then IDfound = AL_FindId(string.sub(dataSource[dataID][i][4], 5), ItemindexID) or dataSource[dataID][i][2]; + if ((dataID == "SearchResult") or (dataID == "WishList")) then + IDfound = AL_FindId(string.sub(dataSource[dataID][i][4], 5), dataSource[dataID][i][AtlasLoot_Difficulty.DIF_SEARCH]) or dataSource[dataID][i][2]; + end if string.sub(IDfound, 1, 1) == "s" then isItem = false; @@ -640,9 +652,16 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame) if dataSource[dataID][i][AtlasLoot_Difficulty.DUPLICATE] then --Used if an item has more then 1 version with the same name eg Atiesh IDfound = AL_FindId(string.sub(dataSource[dataID][i][4], 5) .. " " .. dataSource[dataID][i][AtlasLoot_Difficulty.DUPLICATE], ItemindexID) or dataSource[dataID][i][2]; + if ((dataID == "SearchResult") or (dataID == "WishList")) then + IDfound = AL_FindId(string.sub(dataSource[dataID][i][4], 5), dataSource[dataID][i][AtlasLoot_Difficulty.DIF_SEARCH]) or dataSource[dataID][i][2]; + end else --If something was found in itemID database show that if not show default table item IDfound = AL_FindId(string.sub(dataSource[dataID][i][4], 5), ItemindexID) or dataSource[dataID][i][2]; + if ((dataID == "SearchResult") or (dataID == "WishList")) then + IDfound = AL_FindId(string.sub(dataSource[dataID][i][4], 5), dataSource[dataID][i][AtlasLoot_Difficulty.DIF_SEARCH]) or dataSource[dataID][i][2]; + end + end itemName, itemLink, itemQuality, itemLevel, itemMinLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemTexture = GetItemInfo(IDfound); @@ -777,6 +796,10 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame) if (dataID == "SearchResult" or dataID == "WishList") and dataSource[dataID][i][8] then itemButton.sourcePage = dataSource[dataID][i][8]; end + if (dataID == "SearchResult" or dataID == "WishList") and dataSource[dataID][i][AtlasLoot_Difficulty.DIF_SEARCH] then + itemButton.difficulty = dataSource[dataID][i][AtlasLoot_Difficulty.DIF_SEARCH]; + end + itemButton.i = 1; itemButton:Show(); @@ -786,7 +809,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame) end if dataID ~= "FilterList" then - lastType = dataSource[dataID].Type + lastType = dataSource[dataID].Type end if SelectedTableTextSet then diff --git a/AtlasLoot/Core/AtlasLoot.xml b/AtlasLoot/Core/AtlasLoot.xml index 7183b76..b7472e8 100644 --- a/AtlasLoot/Core/AtlasLoot.xml +++ b/AtlasLoot/Core/AtlasLoot.xml @@ -16,6 +16,7 @@