From 13693de045bb5205ff7099e51400c62caddec7cc Mon Sep 17 00:00:00 2001 From: higurush Date: Fri, 4 Jun 2021 02:50:38 +0200 Subject: [PATCH] Add Item Level Filter for single Filter - Can only filter for iLvl by searching only for iLvl, eg: "ilvl<10" - memo TODOs --- AtlasLoot/Core/Search.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/AtlasLoot/Core/Search.lua b/AtlasLoot/Core/Search.lua index e18bef3..30a65cf 100644 --- a/AtlasLoot/Core/Search.lua +++ b/AtlasLoot/Core/Search.lua @@ -367,6 +367,23 @@ function AtlasLoot:Search(Text) if itemInfoFilter then -- Name, Link, Quality(num), iLvl(num), minLvl(num), itemType(localized string), itemSubType(localized string), stackCount(num), itemEquipLoc(enum), texture(link to a file), displayId(num) local _, _, itemQuality, itemLvl, minLvl, _, _, _, itemEquipLoc = GetItemInfo(itemId); + + -- Currently only supports "&" + local binaryOperator = HaveBinaryOperator(text); + if binaryOperator ~= nil then + -- TODO + else + -- Item Level Filter + if itemLvl ~= nil and itemLvl > 0 and IsEquipableGear(itemEquipLoc) and IsItemLevelFilter(itemInfoFilter) then + local searchedItemLevel = tonumber(string.match(text, "%d+")); + if CompareNumbersByOperator(operator, itemLvl, searchedItemLevel) then + table.insert(AtlasLootCharDB["SearchResult"], { 0, v[2], v[3], itemName, lootpage, "", "", dataID.."|".."\"\"" }); + end + end + -- TODO itemQuality + -- TODO minLvl + -- TODO itemEquipLoc + end end end