From 31b0d404c38d1731fce93b17b04c434af28f079a Mon Sep 17 00:00:00 2001 From: andrew6180 <16847730+andrew6180@users.noreply.github.com> Date: Wed, 20 Sep 2023 08:18:55 -0700 Subject: [PATCH] ElvUI/ItemSearch: Fix item search, still unsure why empty string global is a nameplate now. --- ElvUI/Libraries/LibItemSearch-1.2/LibItemSearch-1.2.lua | 2 +- ElvUI/Libraries/oUF/ouf.lua | 5 +++-- ElvUI/Modules/Bags/Bags.lua | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ElvUI/Libraries/LibItemSearch-1.2/LibItemSearch-1.2.lua b/ElvUI/Libraries/LibItemSearch-1.2/LibItemSearch-1.2.lua index 0a2157b..79d0a4d 100644 --- a/ElvUI/Libraries/LibItemSearch-1.2/LibItemSearch-1.2.lua +++ b/ElvUI/Libraries/LibItemSearch-1.2/LibItemSearch-1.2.lua @@ -123,7 +123,7 @@ Lib.Filters.type = { match = function(self, item, _, search) local type, subType, _, equipSlot = select(6, GetItemInfo(item)) - return Search:Find(search, type, subType, _G[equipSlot]) + return Search:Find(search, type, subType, equipSlot and equipSlot ~= "" and _G[equipSlot]) end } diff --git a/ElvUI/Libraries/oUF/ouf.lua b/ElvUI/Libraries/oUF/ouf.lua index dcd4981..17f423b 100644 --- a/ElvUI/Libraries/oUF/ouf.lua +++ b/ElvUI/Libraries/oUF/ouf.lua @@ -775,6 +775,7 @@ Used to create nameplates and apply the currently active style to them. * variables - list of console variable-value pairs to be set when the player logs in (table?) --]] local nameplateUnitToFrame = {} +local nameplateCounter = CreateCounter() function oUF:SpawnNamePlates(namePrefix, nameplateCallback, nameplateCVars) argcheck(nameplateCallback, 3, 'function', 'nil') argcheck(nameplateCVars, 4, 'table', 'nil') @@ -782,7 +783,7 @@ function oUF:SpawnNamePlates(namePrefix, nameplateCallback, nameplateCVars) if(_G.oUF_NamePlateDriver) then return error('oUF nameplate driver has already been initialized.') end local style = style - local prefix = namePrefix or generateName() + local prefix = namePrefix or generateName(nil, "NamePlate") local eventHandler = CreateFrame('Frame', 'oUF_NamePlateDriver') eventHandler:RegisterEvent('NAME_PLATE_UNIT_ADDED') @@ -838,7 +839,7 @@ function oUF:SpawnNamePlates(namePrefix, nameplateCallback, nameplateCVars) nameplate.style = style nameplate.isNamePlate = true - nameplate.unitFrame = CreateFrame('Button', prefix..tostring(nameplate), nameplate) + nameplate.unitFrame = CreateFrame('Button', prefix.."NamePlate"..nameplateCounter(), nameplate) nameplate.unitFrame:EnableMouse(false) nameplate.unitFrame.isNamePlate = true nameplate.unitFrame.nameplateAnchor = nameplate diff --git a/ElvUI/Modules/Bags/Bags.lua b/ElvUI/Modules/Bags/Bags.lua index 5cd465c..8312b98 100644 --- a/ElvUI/Modules/Bags/Bags.lua +++ b/ElvUI/Modules/Bags/Bags.lua @@ -183,7 +183,6 @@ function B:SetSearch(query) local _, _, _, _, _, _, link = GetContainerItemInfo(bagID, slotID) local button = bagFrame.Bags[bagID][slotID] local success, result = pcall(Search.Matches, Search, link, query) - if empty or (success and result) then SetItemButtonDesaturated(button, button.locked or button.junkDesaturate) button.searchOverlay:Hide()