Skip to content

Commit f495aa5

Browse files
authored
Even More Fixes (#458)
* Searching in Cata now works again! * Fixed the ElvUI search overlay in non-retail setups. * Fixed a bug where search would not clear sometimes when closing the bags. * Re-centered search on the default theme. * In-bag search is enabled by default.
1 parent 816bae9 commit f495aa5

File tree

11 files changed

+25
-11
lines changed

11 files changed

+25
-11
lines changed

annotations.lua

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
---@field IconTexture Texture
2525
---@field ItemSlotBackground Texture
2626
---@field backdrop Frame
27+
---@field searchOverlay Texture
2728
local itemButton = {}
2829

2930
---@param bagid number

core/constants.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ const.DATABASE_DEFAULTS = {
354354
enabled = true,
355355
showBagButton = true,
356356
debug = false,
357-
inBagSearch = false,
357+
inBagSearch = true,
358358
showKeybindWarning = true,
359359
theme = 'Default',
360360
showFullSectionNames = {

frames/bag.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ local windowGroup = addon:GetModule('WindowGroup')
113113
---@field windowGrouping WindowGrouping
114114
---@field sideAnchor Frame
115115
---@field previousSize number
116+
---@field searchFrame SearchFrame
116117
bagFrame.bagProto = {}
117118

118119
function bagFrame.bagProto:Show()
@@ -133,6 +134,8 @@ function bagFrame.bagProto:Hide()
133134
self.frame:Hide()
134135
if self.kind == const.BAG_KIND.BANK then
135136
CloseBankFrame()
137+
elseif self.kind == const.BAG_KIND.BACKPACK then
138+
self.searchFrame:Hide()
136139
end
137140
if self.drawOnClose and self.kind == const.BAG_KIND.BACKPACK then
138141
debug:Log("draw", "Drawing bag on close")
@@ -426,7 +429,8 @@ function bagFrame:Create(kind)
426429
b.slots = slots
427430

428431
if kind == const.BAG_KIND.BACKPACK then
429-
search:Create(b.frame)
432+
print("search frame made")
433+
b.searchFrame = search:Create(b.frame)
430434
end
431435

432436
if kind == const.BAG_KIND.BACKPACK then

frames/classic/bag.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function bagFrame:Create(kind)
166166
b.slots = slots
167167

168168
if kind == const.BAG_KIND.BACKPACK then
169-
search:Create(b.frame)
169+
b.searchFrame = search:Create(b.frame)
170170
end
171171

172172
if kind == const.BAG_KIND.BACKPACK then

frames/era/bag.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ function bagFrame:Create(kind)
265265
b.slots = slots
266266

267267
if kind == const.BAG_KIND.BACKPACK then
268-
search:Create(b.frame)
268+
b.searchFrame = search:Create(b.frame)
269269
end
270270

271271
if kind == const.BAG_KIND.BACKPACK then

frames/search.lua

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ end
4545

4646
function search.searchProto:Hide()
4747
if self.frame:IsShown() then
48+
self.textBox:SetText("")
4849
self.textBox:ClearFocus()
4950
if self.fadeOutGroup then
5051
self.fadeOutGroup:Play()

frames/sectionconfig.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ function sectionConfigFrame:initSectionItem(button, elementData)
116116
button.Expand:SetNormalTexture("Interface\\glues\\common\\glue-leftarrow-button-up")
117117
button.Expand:SetPushedTexture("Interface\\glues\\common\\glue-leftarrow-button-down")
118118
button.Expand:SetHighlightTexture("Interface\\glues\\common\\glue-leftarrow-button-highlight", "ADD")
119-
button.Visible:SetNormalTexture("Interface\\Addons\\BetterBags\\textures\\visible.png")
120-
button.Visible:SetHighlightTexture("Interface\\Addons\\BetterBags\\textures\\visible.png")
119+
button.Visible:SetNormalTexture("Interface\\AddOns\\BetterBags\\textures\\visible.blp")
120+
button.Visible:SetHighlightTexture("Interface\\Addons\\BetterBags\\textures\\visible.blp")
121121
button.Visible:SetScript("OnEnter", function()
122122
GameTooltip:SetOwner(button, "ANCHOR_LEFT")
123123
GameTooltip:AddLine("Show or hide this category in the bags.", 1, .81960791349411, 0, true)

textures/visible.blp

1.52 KB
Binary file not shown.

themes/default.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ local defaultTheme = {
4444
end)
4545

4646
local searchBox = search:CreateBox(frame.Owner.kind, decoration --[[@as Frame]])
47-
searchBox.frame:SetPoint("TOPRIGHT", decoration, "TOPRIGHT", -22, -2)
47+
searchBox.frame:SetPoint("TOP", decoration, "TOP", 0, -2)
4848
searchBox.frame:SetSize(150, 20)
4949
decoration.search = searchBox
5050

@@ -117,6 +117,11 @@ local defaultTheme = {
117117
local decoration = decoratorFrames[frame:GetName()]
118118
if decoration then
119119
decoration.search:SetShown(shown)
120+
if shown then
121+
decoration.TitleContainer:Hide()
122+
else
123+
decoration.TitleContainer:Show()
124+
end
120125
end
121126
end
122127
}

themes/elvui.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ local theme = {
165165
S:HandleItemButton(button, true)
166166
S:HandleIconBorder(button.IconBorder)
167167
button:Show()
168+
if not addon.isRetail then
169+
button.searchOverlay = button:CreateTexture(nil, "ARTWORK")
170+
button.searchOverlay:SetColorTexture(0, 0, 0, 0.8)
171+
button.searchOverlay:SetAllPoints()
172+
end
168173

169174
button:GetNormalTexture():SetAlpha(0)
170175
button:SetHighlightTexture(E.Media.Textures.White8x8)
@@ -192,7 +197,6 @@ local theme = {
192197
end
193198
button.IconQuestTexture.Hide = function()
194199
quest_overlay:Hide()
195-
--button.IconBorder:SetVertexColor(1, 1, 1, 1)
196200
end
197201
end
198202
if button.Cooldown then

themes/themes.lua

+2-3
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,10 @@ end
269269
function themes.CreateBlankItemButtonDecoration(parent, theme, buttonName)
270270
---@type ItemButton
271271
local button
272-
if not addon.isClassic then
272+
if addon.isRetail then
273273
button = CreateFrame("ItemButton", buttonName.."Decoration"..theme, parent, "ContainerFrameItemButtonTemplate") --[[@as ItemButton]]
274-
button:SetAllPoints()
275274
else
276275
button = CreateFrame("Button", buttonName.."Decoration"..theme, parent, "ContainerFrameItemButtonTemplate") --[[@as ItemButton]]
277-
button:SetAllPoints()
278276
---@diagnostic disable-next-line: duplicate-set-field
279277
button.SetMatchesSearch = function(me, match)
280278
if match then
@@ -284,6 +282,7 @@ function themes.CreateBlankItemButtonDecoration(parent, theme, buttonName)
284282
end
285283
end
286284
end
285+
button:SetAllPoints()
287286

288287
if addon.isRetail then
289288
button.ItemSlotBackground = button:CreateTexture(nil, "BACKGROUND", "ItemSlotBackgroundCombinedBagsTemplate", -6)

0 commit comments

Comments
 (0)