ElvUI/ItemSearch: Fix item search, still unsure why empty string global is a nameplate now.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user