Guda_BagFrame:Hide()
local icon = getglobal(this:GetName().."_Icon")
if icon then
icon:SetTexture("Interface\\AddOns\\Guda\\Assets\\Cog")
icon:SetTexCoord(0, 1, 0, 1)
end
Guda_OpenSettings()
GameTooltip:SetOwner(this, "ANCHOR_TOP")
GameTooltip:SetText("Settings")
GameTooltip:Show()
GameTooltip:Hide()
local icon = getglobal(this:GetName().."_Icon")
if icon then
-- BagShui approach: no file extension, WoW finds .blp automatically
icon:SetTexture("Interface\\AddOns\\Guda\\Assets\\Sorting")
icon:SetTexCoord(0, 1, 0, 1)
end
Guda_BagFrame_Sort()
GameTooltip:SetOwner(this, "ANCHOR_TOP")
if this.isCategoryView then
GameTooltip:SetText("Restack and Clean")
GameTooltip:AddLine("Merges split stacks and refreshes the view", 0.7, 0.7, 0.7)
else
GameTooltip:SetText("Sort Bags")
end
GameTooltip:Show()
GameTooltip:Hide()
local icon = getglobal(this:GetName().."_Icon")
if icon then
icon:SetTexture("Interface\\AddOns\\Guda\\Assets\\All_Characters")
icon:SetTexCoord(0, 1, 0, 1)
end
Guda_BagFrame_ToggleCharacterDropdown(this)
GameTooltip:SetOwner(this, "ANCHOR_TOP")
GameTooltip:SetText("My Characters")
GameTooltip:Show()
GameTooltip:Hide()
local icon = getglobal(this:GetName().."_Icon")
if icon then
icon:SetTexture("Interface\\AddOns\\Guda\\Assets\\Chest")
icon:SetTexCoord(0, 1, 0, 1)
end
Guda_BagFrame_ToggleBankDropdown(this)
GameTooltip:SetOwner(this, "ANCHOR_TOP")
GameTooltip:SetText("View Bank")
GameTooltip:Show()
GameTooltip:Hide()
local icon = getglobal(this:GetName().."_Icon")
if icon then
icon:SetTexture("Interface\\AddOns\\Guda\\Assets\\Envelope")
end
Guda_BagFrame_ToggleMailDropdown(this)
GameTooltip:SetOwner(this, "ANCHOR_TOP")
GameTooltip:SetText("View Mailbox")
GameTooltip:Show()
GameTooltip:Hide()
-- Clear search focus when clicking toolbar
local searchBox = getglobal("Guda_BagFrame_SearchBar_SearchBox")
if searchBox then
searchBox:ClearFocus()
end
Guda_BagSlot_OnLoad(this, 0)
Guda_BagSlot_OnClick(this, 0)
Guda_BagSlot_OnEnter(this, 0)
GameTooltip:Hide()
Guda_BagFrame_ClearHighlightedSlots()
Guda_BagSlot_OnLeave(this, 0)
Guda_BagSlot_OnEvent(this, event, arg1)
this:RegisterForDrag("LeftButton")
Guda_BagSlot_OnLoad(this, 1)
Guda_BagSlot_OnClick(this, 1)
Guda_BagSlot_OnEnter(this, 1)
Guda_BagSlot_OnDragStart(this, 1)
Guda_BagSlot_OnDragStop(this, 1)
GameTooltip:Hide()
Guda_BagFrame_ClearHighlightedSlots()
Guda_BagSlot_OnLeave(this, 1)
Guda_BagSlot_OnEvent(this, event, arg1)
this:RegisterForDrag("LeftButton")
Guda_BagSlot_OnLoad(this, 2)
Guda_BagSlot_OnClick(this, 2)
Guda_BagSlot_OnEnter(this, 2)
Guda_BagSlot_OnDragStart(this, 2)
Guda_BagSlot_OnDragStop(this, 2)
GameTooltip:Hide()
Guda_BagFrame_ClearHighlightedSlots()
Guda_BagSlot_OnLeave(this, 2)
Guda_BagSlot_OnEvent(this, event, arg1)
this:RegisterForDrag("LeftButton")
Guda_BagSlot_OnLoad(this, 3)
Guda_BagSlot_OnClick(this, 3)
Guda_BagSlot_OnEnter(this, 3)
Guda_BagSlot_OnDragStart(this, 3)
Guda_BagSlot_OnDragStop(this, 3)
GameTooltip:Hide()
Guda_BagFrame_ClearHighlightedSlots()
Guda_BagSlot_OnLeave(this, 3)
Guda_BagSlot_OnEvent(this, event, arg1)
this:RegisterForDrag("LeftButton")
Guda_BagSlot_OnLoad(this, 4)
Guda_BagSlot_OnClick(this, 4)
Guda_BagSlot_OnEnter(this, 4)
Guda_BagSlot_OnDragStart(this, 4)
Guda_BagSlot_OnDragStop(this, 4)
GameTooltip:Hide()
Guda_BagFrame_ClearHighlightedSlots()
Guda_BagSlot_OnLeave(this, 4)
Guda_BagSlot_OnEvent(this, event, arg1)
-- Hide borders (same as bag slots)
local normalTexture = getglobal(this:GetName().."NormalTexture")
if normalTexture then
normalTexture:SetTexture(nil)
normalTexture:Hide()
end
local iconBorder = getglobal(this:GetName().."IconBorder")
if iconBorder then
iconBorder:Hide()
end
-- Apply footer button backdrop
Guda_BagSlot_ApplyBackdrop(this)
-- Set keyring icon
SetItemButtonTexture(this, "Interface\\AddOns\\Guda\\Assets\\keyring")
this:RegisterForClicks("LeftButtonUp", "RightButtonUp")
Guda_BagFrame_ToggleKeyring()
Guda_BagSlot_OnEnter(this, -2)
GameTooltip:Hide()
Guda_BagFrame_ClearHighlightedSlots()
Guda_BagSlot_OnLeave(this, -2)
-- Hide borders (same as keyring/bag slots)
local normalTexture = getglobal(this:GetName().."NormalTexture")
if normalTexture then
normalTexture:SetTexture(nil)
normalTexture:Hide()
end
local iconBorder = getglobal(this:GetName().."IconBorder")
if iconBorder then
iconBorder:Hide()
end
-- Hide the stock/count text from ItemButtonTemplate
local countText = getglobal(this:GetName().."Count")
if countText then
countText:Hide()
end
-- Apply footer button backdrop
Guda_BagSlot_ApplyBackdrop(this)
-- Set soul bag icon
SetItemButtonTexture(this, "Interface\\AddOns\\Guda\\Assets\\soul")
this:RegisterForClicks("LeftButtonUp")
-- Create custom count FontString overlay
local shardCount = this:CreateFontString(nil, "OVERLAY", "NumberFontNormal")
shardCount:SetPoint("BOTTOMRIGHT", this, "BOTTOMRIGHT", -2, 2)
shardCount:SetText("")
shardCount:Hide()
this.countText = shardCount
this.soulShardCount = 0
-- Check player class — hide button if not Warlock
local _, playerClass = UnitClass("player")
if playerClass ~= "WARLOCK" then
this:Hide()
end
Guda_BagFrame_ToggleSoulBag()
GameTooltip:SetOwner(this, "ANCHOR_TOP")
GameTooltip:SetText("Soul Bag", 1.0, 1.0, 1.0)
local count = this.soulShardCount or 0
GameTooltip:AddLine(string.format("%d Soul Shards", count), 0.8, 0.8, 0.8)
GameTooltip:Show()
GameTooltip:Hide()
local text = getglobal(this:GetName().."_Text")
if text then
text:SetText("0 / 0")
text:SetTextColor(0.8, 0.8, 0.8)
end
if this:GetText() == "Search, try ~equipment" then
this:SetText("")
this:SetTextColor(1, 1, 1, 1)
end
-- Show click catcher to detect clicks outside bag
local clickCatcher = getglobal("Guda_ClickCatcher")
if clickCatcher then clickCatcher:Show() end
-- Hide click catcher when focus is lost
local clickCatcher = getglobal("Guda_ClickCatcher")
if clickCatcher then clickCatcher:Hide() end
-- Restore placeholder if empty when focus is lost
if this:GetText() == "" then
this:SetText("Search, try ~equipment")
this:SetTextColor(0.5, 0.5, 0.5, 1)
Guda_BagFrame_OnSearchChanged(this)
end
Guda_BagFrame_OnSearchChanged(this)
this:SetText("Search, try ~equipment")
this:SetTextColor(0.5, 0.5, 0.5, 1)
this:ClearFocus()
Guda_BagFrame_OnSearchChanged(this)
-- Set tooltip handlers on money button children
Guda_BagFrame_MoneyFrame_OnLoad(this)
Guda_BagFrame_OnLoad(this)
Guda_BagFrame_OnShow(this)
Guda_BagFrame_OnHide(this)
-- Clear search box focus when clicking on bag frame (1.12.1 safe)
local searchBox = getglobal("Guda_BagFrame_SearchBar_SearchBox")
if searchBox then
searchBox:ClearFocus()
end
if (arg1 == "LeftButton") then
this:StartMoving()
end
this:StopMovingOrSizing()