This commit is contained in:
Bunny67
2018-01-12 01:36:31 +03:00
parent 2d223bef31
commit 4ff1537d8d
+8 -8
View File
@@ -1,6 +1,6 @@
local E, L, V, P, G = unpack(ElvUI) local E, L, V, P, G = unpack(ElvUI)
local B = E:NewModule("Bags", "AceHook-3.0", "AceEvent-3.0", "AceTimer-3.0") local B = E:NewModule("Bags", "AceHook-3.0", "AceEvent-3.0", "AceTimer-3.0")
local Search = LibStub("LibItemSearch-1.2", true) local Search = LibStub("LibItemSearch-1.2")
-- local LIP = LibStub("ItemPrice-1.1", true) -- local LIP = LibStub("ItemPrice-1.1", true)
--Cache global variables --Cache global variables
@@ -153,7 +153,7 @@ function B:ResetAndClear()
local editbox = this:GetParent().editBox or this local editbox = this:GetParent().editBox or this
if editbox then editbox:SetText(SEARCH) end if editbox then editbox:SetText(SEARCH) end
-- this:ClearFocus() this:ClearFocus()
B:SearchReset() B:SearchReset()
end end
@@ -164,7 +164,7 @@ function B:SetSearch(query)
for slotID = 1, GetContainerNumSlots(bagID) do for slotID = 1, GetContainerNumSlots(bagID) do
local link = GetContainerItemLink(bagID, slotID) local link = GetContainerItemLink(bagID, slotID)
local button = bagFrame.Bags[bagID][slotID] local button = bagFrame.Bags[bagID][slotID]
-- local success, result = pcall(Search.Matches, Search, link, query) local success, result = pcall(Search.Matches, Search, link, query)
if empty or (success and result) then if empty or (success and result) then
SetItemButtonDesaturated(button) SetItemButtonDesaturated(button)
button:SetAlpha(1) button:SetAlpha(1)
@@ -181,7 +181,7 @@ function B:SetSearch(query)
for slotID = 1, numKey do for slotID = 1, numKey do
local link = GetContainerItemLink(KEYRING_CONTAINER, slotID) local link = GetContainerItemLink(KEYRING_CONTAINER, slotID)
local button = _G["ElvUIKeyFrameItem"..slotID] local button = _G["ElvUIKeyFrameItem"..slotID]
-- local success, result = pcall(Search.Matches, Search, link, query) local success, result = pcall(Search.Matches, Search, link, query)
if empty or (success and result) then if empty or (success and result) then
SetItemButtonDesaturated(button) SetItemButtonDesaturated(button)
button:SetAlpha(1) button:SetAlpha(1)
@@ -928,8 +928,8 @@ function B:ContructContainerFrame(name, isBank)
f.editBox:SetPoint("RIGHT", f.purchaseBagButton, "LEFT", -5, 0) f.editBox:SetPoint("RIGHT", f.purchaseBagButton, "LEFT", -5, 0)
f.editBox:SetAutoFocus(false) f.editBox:SetAutoFocus(false)
f.editBox:SetScript("OnEscapePressed", self.ResetAndClear) f.editBox:SetScript("OnEscapePressed", self.ResetAndClear)
f.editBox:SetScript("OnEnterPressed", function(self) self:ClearFocus() end) f.editBox:SetScript("OnEnterPressed", function() this:ClearFocus() end)
f.editBox:SetScript("OnEditFocusGained", f.editBox.HighlightText) f.editBox:SetScript("OnEditFocusGained", function() this:HighlightText() end)
f.editBox:SetScript("OnTextChanged", self.UpdateSearch) f.editBox:SetScript("OnTextChanged", self.UpdateSearch)
f.editBox:SetScript("OnChar", self.UpdateSearch) f.editBox:SetScript("OnChar", self.UpdateSearch)
f.editBox:SetText(SEARCH) f.editBox:SetText(SEARCH)
@@ -1037,8 +1037,8 @@ function B:ContructContainerFrame(name, isBank)
f.editBox:SetPoint("RIGHT", f.vendorGraysButton, "LEFT", -5, 0) f.editBox:SetPoint("RIGHT", f.vendorGraysButton, "LEFT", -5, 0)
f.editBox:SetAutoFocus(false) f.editBox:SetAutoFocus(false)
f.editBox:SetScript("OnEscapePressed", self.ResetAndClear) f.editBox:SetScript("OnEscapePressed", self.ResetAndClear)
f.editBox:SetScript("OnEnterPressed", function(self) self:ClearFocus() end) f.editBox:SetScript("OnEnterPressed", function() this:ClearFocus() end)
f.editBox:SetScript("OnEditFocusGained", f.editBox.HighlightText) f.editBox:SetScript("OnEditFocusGained", function() this:HighlightText() end)
f.editBox:SetScript("OnTextChanged", self.UpdateSearch) f.editBox:SetScript("OnTextChanged", self.UpdateSearch)
f.editBox:SetScript("OnChar", self.UpdateSearch) f.editBox:SetScript("OnChar", self.UpdateSearch)
f.editBox:SetText(SEARCH) f.editBox:SetText(SEARCH)