ElvUI/ItemSearch: Fix item search, still unsure why empty string global is a nameplate now.

This commit is contained in:
andrew6180
2023-09-20 08:18:55 -07:00
parent 792713fff7
commit 31b0d404c3
3 changed files with 4 additions and 4 deletions
@@ -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
}
+3 -2
View File
@@ -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
-1
View File
@@ -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()