fixed bugs after relogging/reloading UI when last opened page was WishList or Search
removed redundant menu of world epics, removed fashion table (I don't see the point of keeping it since you can preview everything in the turtle shop itself anyway)
tooltip source is now more accurate and lighter on performance
moved buttons in atlasloot panel in Atlas to save some space
This commit is contained in:
Spit
2025-05-06 19:21:51 +03:00
parent c2e2e84fc4
commit 815ad7141e
9 changed files with 306 additions and 458 deletions
+64 -62
View File
@@ -11,7 +11,7 @@ local currentPage = 1;
local SearchResult = nil;
function AtlasLoot:ShowSearchResult()
AtlasLoot_ShowItemsFrame("SearchResult", "SearchResultPage"..currentPage, string.format((AL["Search Result: %s"]), AtlasLootCharDB.LastSearchedText or ""), pFrame);
AtlasLoot_ShowItemsFrame("SearchResult", "SearchResultPage"..currentPage, string.format((AL["Search Result: %s"]), AtlasLootCharDB.LastSearchedText or ""), AtlasLoot_AnchorPoint);
end
local function strtrim(s)
@@ -27,66 +27,68 @@ function AtlasLoot:Search(Text)
if dataSource == "AtlasLootFallback" then return end
local partial = AtlasLootCharDB.PartialMatching;
for dataID, data in pairs(AtlasLoot_Data[dataSource]) do
for _, v in ipairs(data) do
if type(v[1]) ~= "table" then
-- item
if type(v[1]) == "number" and v[1] > 0 then
local itemName = GetItemInfo(v[1]);
if not itemName then itemName = gsub(v[3], "=q%d=", "") end
local found;
if partial then
found = string.find(string.lower(itemName), text);
else
found = string.lower(itemName) == text;
end
if found then
local _, _, quality = string.find(v[3], "=q(%d)=");
if quality then itemName = "=q"..quality.."="..itemName end
table.insert(AtlasLootCharDB["SearchResult"], { v[1], v[2], itemName, v[4], dataID.."|"..dataSource });
end
-- spell
elseif (v[1] ~= nil) and (v[1] ~= "") and (string.sub(v[1], 1, 1) == "s") then
local spellName
if not spellName then
if (string.sub(v[3], 1, 2) == "=d") then
spellName = gsub(v[3], "=ds=", "");
else
spellName = gsub(v[3], "=q%d=", "");
end
end
local found;
if partial then
found = string.find(string.lower(spellName), text);
else
found = string.lower(spellName) == text;
end
if found then
spellName = string.sub(v[3], 1, 4)..spellName;
table.insert(AtlasLootCharDB["SearchResult"], { v[1], v[2], spellName, v[4], dataID.."|"..dataSource });
end
-- enchant
elseif (v[1] ~= nil) and (v[1] ~= "") and (string.sub(v[1], 1, 1) == "e") then
local spellName
if not spellName then
if (string.sub(v[3], 1, 2) == "=d") then
spellName = gsub(v[3], "=ds=", "");
else
spellName = gsub(v[3], "=q%d=", "");
end
end
local found;
if partial then
found = string.find(string.lower(spellName), text);
else
found = string.lower(spellName) == text;
end
if found then
spellName = string.sub(v[3], 1, 4)..spellName;
table.insert(AtlasLootCharDB["SearchResult"], { v[1], v[2], spellName, v[4], dataID.."|"..dataSource });
end
end
end
end
if type(data) == "table" then
for _, v in ipairs(data) do
if type(v[1]) ~= "table" then
-- item
if type(v[1]) == "number" and v[1] > 0 then
local itemName = GetItemInfo(v[1]);
if not itemName then itemName = gsub(v[3], "=q%d=", "") end
local found;
if partial then
found = string.find(string.lower(itemName), text);
else
found = string.lower(itemName) == text;
end
if found then
local _, _, quality = string.find(v[3], "=q(%d)=");
if quality then itemName = "=q"..quality.."="..itemName end
table.insert(AtlasLootCharDB["SearchResult"], { v[1], v[2], itemName, v[4], dataID.."|"..dataSource });
end
-- spell
elseif (v[1] ~= nil) and (v[1] ~= "") and (string.sub(v[1], 1, 1) == "s") then
local spellName
if not spellName then
if (string.sub(v[3], 1, 2) == "=d") then
spellName = gsub(v[3], "=ds=", "");
else
spellName = gsub(v[3], "=q%d=", "");
end
end
local found;
if partial then
found = string.find(string.lower(spellName), text);
else
found = string.lower(spellName) == text;
end
if found then
spellName = string.sub(v[3], 1, 4)..spellName;
table.insert(AtlasLootCharDB["SearchResult"], { v[1], v[2], spellName, v[4], dataID.."|"..dataSource });
end
-- enchant
elseif (v[1] ~= nil) and (v[1] ~= "") and (string.sub(v[1], 1, 1) == "e") then
local spellName
if not spellName then
if (string.sub(v[3], 1, 2) == "=d") then
spellName = gsub(v[3], "=ds=", "");
else
spellName = gsub(v[3], "=q%d=", "");
end
end
local found;
if partial then
found = string.find(string.lower(spellName), text);
else
found = string.lower(spellName) == text;
end
if found then
spellName = string.sub(v[3], 1, 4)..spellName;
table.insert(AtlasLootCharDB["SearchResult"], { v[1], v[2], spellName, v[4], dataID.."|"..dataSource });
end
end
end
end
end
end
end
@@ -99,7 +101,7 @@ function AtlasLoot:Search(Text)
else
currentPage = 1;
SearchResult = AtlasLoot_CategorizeWishList(AtlasLootCharDB["SearchResult"]);
AtlasLoot_ShowItemsFrame("SearchResult", "SearchResultPage1", string.format((AL["Search Result: %s"]), AtlasLootCharDB.LastSearchedText or ""), pFrame);
AtlasLoot_ShowItemsFrame("SearchResult", "SearchResultPage1", string.format((AL["Search Result: %s"]), AtlasLootCharDB.LastSearchedText or ""), AtlasLoot_AnchorPoint);
end
end