wish lists are now working

This commit is contained in:
Anch
2022-08-02 22:47:34 +12:00
parent 4e6d41f1e1
commit 12b7b72376
13 changed files with 105 additions and 2861 deletions
-29
View File
@@ -827,32 +827,3 @@ function AtlasLoot:GetOriginalDataFromSearchResult(itemID)
end
end
-- Copied and modified from AtlasLoot_GetWishListPage
function AtlasLoot:GetSearchResultPage(page)
if not SearchResult then
SearchResult = AtlasLoot_CategorizeWishList(AtlasLootCharDB["SearchResult"])
end
-- Calc for maximal pages
local pageMax = math.ceil(#SearchResult / 30);
if page < 1 then
page = 1
end
if page > pageMax then
page = pageMax
end
currentPage = page;
-- Table copy
local k = 1;
local result = {};
local start = (page - 1) * 30 + 1;
for i = start, start + 29 do
if not SearchResult[i] then
break
end
SearchResult[i][1] = k;
table.insert(result, SearchResult[i]);
k = k + 1;
end
return result, pageMax;
end