Files
Guda-ClassicAPI/UI/BankFrame.xml
T
2026-04-09 04:06:37 +04:00

703 lines
30 KiB
XML

<Ui xmlns="http://www.blizzard.com/wow/ui/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
<!-- Bank Frame -->
<Frame name="Guda_BankFrame" toplevel="true" movable="true" enableMouse="true" hidden="true" parent="UIParent">
<Size>
<AbsDimension x="420" y="540"/>
</Size>
<Anchors>
<Anchor point="CENTER" relativePoint="CENTER" relativeTo="UIParent">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<!-- Title at top -->
<Layer level="ARTWORK">
<FontString name="$parent_Title" inherits="GameFontNormalLarge">
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-12"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<!-- Close Button -->
<Button name="$parent_CloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-16" y="-10"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
Guda_BankFrame:Hide()
</OnClick>
</Scripts>
</Button>
<!-- Sort Button (header right, next to settings) -->
<Button name="$parent_SortButton">
<Size>
<AbsDimension x="24" y="22"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT" relativePoint="TOPLEFT" relativeTo="$parent_CloseButton">
<Offset>
<AbsDimension x="-32" y="-5"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parent_Icon">
<Size>
<AbsDimension x="20" y="18"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Color r="0.8" g="0.8" b="0.8"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
local icon = getglobal(this:GetName().."_Icon")
if icon then
-- No file extension, WoW finds .blp automatically
icon:SetTexture("Interface\\AddOns\\Guda\\Assets\\Sorting")
icon:SetTexCoord(0, 1, 0, 1)
end
</OnLoad>
<OnClick>
Guda_BankFrame_Sort()
</OnClick>
<OnEnter>
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(Guda_L["Sort Bank"])
end
GameTooltip:Show()
</OnEnter>
<OnLeave>
GameTooltip:Hide()
</OnLeave>
</Scripts>
</Button>
<!-- Settings Button (header right, next to close) -->
<Button name="$parent_SettingsButton">
<Size>
<AbsDimension x="24" y="22"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT" relativePoint="TOPLEFT" relativeTo="$parent_CloseButton">
<Offset>
<AbsDimension x="0" y="-5"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parent_Icon">
<Size>
<AbsDimension x="20" y="18"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Color r="0.8" g="0.8" b="0.8"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
local icon = getglobal(this:GetName().."_Icon")
if icon then
icon:SetTexture("Interface\\AddOns\\Guda\\Assets\\Cog")
icon:SetTexCoord(0, 1, 0, 1)
end
</OnLoad>
<OnClick>
Guda_OpenSettings()
</OnClick>
<OnEnter>
GameTooltip:SetOwner(this, "ANCHOR_TOP")
GameTooltip:SetText(Guda_L["Settings"])
GameTooltip:Show()
</OnEnter>
<OnLeave>
GameTooltip:Hide()
</OnLeave>
</Scripts>
</Button>
<!-- Blizzard UI Button (header left) -->
<Button name="$parent_BlizzardUIButton">
<Size>
<AbsDimension x="24" y="22"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="23" y="-15"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parent_Icon">
<Size>
<AbsDimension x="20" y="18"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Color r="0.8" g="0.8" b="0.8"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
local icon = getglobal(this:GetName().."_Icon")
if icon then
icon:SetTexture("Interface\\AddOns\\Guda\\Assets\\Chest")
icon:SetTexCoord(0, 1, 0, 1)
end
</OnLoad>
<OnClick>
Guda_BankFrame_SwitchToBlizzardUI()
</OnClick>
<OnEnter>
GameTooltip:SetOwner(this, "ANCHOR_TOP")
GameTooltip:SetText(Guda_L["Use Blizzard Bank UI"])
GameTooltip:Show()
</OnEnter>
<OnLeave>
GameTooltip:Hide()
</OnLeave>
</Scripts>
</Button>
<!-- Characters Button (header left, next to Blizzard UI button) -->
<Button name="$parent_CharsButton">
<Size>
<AbsDimension x="24" y="22"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_BlizzardUIButton">
<Offset>
<AbsDimension x="4" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parent_Icon">
<Size>
<AbsDimension x="20" y="18"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Color r="0.8" g="0.8" b="0.8"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
local icon = getglobal(this:GetName().."_Icon")
if icon then
icon:SetTexture("Interface\\AddOns\\Guda\\Assets\\All_Characters")
icon:SetTexCoord(0, 1, 0, 1)
end
</OnLoad>
<OnClick>
Guda_BankFrame_ToggleBankDropdown(this)
</OnClick>
<OnEnter>
GameTooltip:SetOwner(this, "ANCHOR_TOP")
GameTooltip:SetText(Guda_L["View Bank"])
GameTooltip:Show()
</OnEnter>
<OnLeave>
GameTooltip:Hide()
</OnLeave>
</Scripts>
</Button>
<!-- Search Bar (below title) -->
<Frame name="$parent_SearchBar">
<Size>
<AbsDimension x="400" y="30"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-40"/>
</Offset>
</Anchor>
</Anchors>
<Frames>
<!-- Full-width Search Box -->
<EditBox name="$parent_SearchBox" autoFocus="false" inherits="InputBoxTemplate">
<Size>
<AbsDimension x="0" y="20"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="16" y="0"/>
</Offset>
</Anchor>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="-10" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnEditFocusGained>
if this:GetText() == "Search bank..." then
this:SetText("")
this:SetTextColor(1, 1, 1, 1)
end
-- Show bank click catcher to detect clicks outside bank while typing
local cc = getglobal("Guda_BankClickCatcher")
if cc then cc:Show() end
</OnEditFocusGained>
<OnEditFocusLost>
-- Hide bank click catcher when focus is lost
local cc = getglobal("Guda_BankClickCatcher")
if cc then cc:Hide() end
if this:GetText() == "" then
this:SetText("Search bank...")
this:SetTextColor(0.5, 0.5, 0.5, 1)
Guda_BankFrame_OnSearchChanged(this)
end
</OnEditFocusLost>
<OnTextChanged>
Guda_BankFrame_OnSearchChanged(this)
-- Show/hide clear button based on search content
local clearBtn = getglobal("Guda_BankFrame_SearchBar_ClearButton")
if clearBtn then
local text = this:GetText()
if text ~= "" and text ~= "Search bank..." then
clearBtn:Show()
else
clearBtn:Hide()
end
end
</OnTextChanged>
<OnEscapePressed>
this:SetText("Search bank...")
this:SetTextColor(0.5, 0.5, 0.5, 1)
this:ClearFocus()
Guda_BankFrame_OnSearchChanged(this)
local cc = getglobal("Guda_BankClickCatcher")
if cc then cc:Hide() end
</OnEscapePressed>
</Scripts>
</EditBox>
<!-- Clear Search Button -->
<Button name="$parent_ClearButton" hidden="true">
<Size>
<AbsDimension x="12" y="12"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="$parent_SearchBox" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-5" y="0"/>
</Offset>
</Anchor>
</Anchors>
<NormalTexture file="Interface\AddOns\Guda\Assets\close"/>
<Scripts>
<OnLoad>
local searchBox = getglobal("Guda_BankFrame_SearchBar_SearchBox")
if searchBox then
this:SetFrameLevel(searchBox:GetFrameLevel() + 1)
end
local tex = this:GetNormalTexture()
if tex then tex:SetVertexColor(0.4, 0.4, 0.4) end
</OnLoad>
<OnClick>
Guda_BankFrame_ClearSearch()
</OnClick>
<OnEnter>
local tex = this:GetNormalTexture()
if tex then tex:SetVertexColor(0.7, 0.7, 0.7) end
</OnEnter>
<OnLeave>
local tex = this:GetNormalTexture()
if tex then tex:SetVertexColor(0.4, 0.4, 0.4) end
</OnLeave>
</Scripts>
</Button>
</Frames>
</Frame>
<!-- Toolbar Container (for bank slots info) -->
<Frame name="$parent_Toolbar" enableMouse="true">
<Size>
<AbsDimension x="200" y="40"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="15" y="5"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnMouseDown>
-- Clear search focus when clicking toolbar
local searchBox = getglobal("Guda_BankFrame_SearchBar_SearchBox")
if searchBox then
searchBox:ClearFocus()
end
</OnMouseDown>
</Scripts>
<Frames>
<!-- Main Bank Bag Button (bag -1) -->
<Button name="$parent_BankBagMain" inherits="ItemButtonTemplate">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="8" y="2"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
Guda_BankBagSlot_OnLoad(this, -1)
</OnLoad>
<OnEnter>
Guda_BankBagSlot_OnEnter(this, -1)
Guda_BankFrame_HighlightBagSlots(-1)
</OnEnter>
<OnLeave>
GameTooltip:Hide()
Guda_BankFrame_ClearHighlightedSlots()
</OnLeave>
</Scripts>
</Button>
<!-- Bank Bag Slot 5 -->
<Button name="$parent_BankBag5" inherits="ItemButtonTemplate">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_BankBagMain">
<Offset>
<AbsDimension x="1" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
Guda_BankBagSlot_OnLoad(this, 5)
</OnLoad>
<OnEnter>
Guda_BankBagSlot_OnEnter(this, 5)
Guda_BankFrame_HighlightBagSlots(5)
</OnEnter>
<OnLeave>
GameTooltip:Hide()
Guda_BankFrame_ClearHighlightedSlots()
</OnLeave>
</Scripts>
</Button>
<!-- Bank Bag Slot 6 -->
<Button name="$parent_BankBag6" inherits="ItemButtonTemplate">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_BankBag5">
<Offset>
<AbsDimension x="1" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
Guda_BankBagSlot_OnLoad(this, 6)
</OnLoad>
<OnEnter>
Guda_BankBagSlot_OnEnter(this, 6)
Guda_BankFrame_HighlightBagSlots(6)
</OnEnter>
<OnLeave>
GameTooltip:Hide()
Guda_BankFrame_ClearHighlightedSlots()
</OnLeave>
</Scripts>
</Button>
<!-- Bank Bag Slot 7 -->
<Button name="$parent_BankBag7" inherits="ItemButtonTemplate">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_BankBag6">
<Offset>
<AbsDimension x="1" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
Guda_BankBagSlot_OnLoad(this, 7)
</OnLoad>
<OnEnter>
Guda_BankBagSlot_OnEnter(this, 7)
Guda_BankFrame_HighlightBagSlots(7)
</OnEnter>
<OnLeave>
GameTooltip:Hide()
Guda_BankFrame_ClearHighlightedSlots()
</OnLeave>
</Scripts>
</Button>
<!-- Bank Bag Slot 8 -->
<Button name="$parent_BankBag8" inherits="ItemButtonTemplate">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_BankBag7">
<Offset>
<AbsDimension x="1" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
Guda_BankBagSlot_OnLoad(this, 8)
</OnLoad>
<OnEnter>
Guda_BankBagSlot_OnEnter(this, 8)
Guda_BankFrame_HighlightBagSlots(8)
</OnEnter>
<OnLeave>
GameTooltip:Hide()
Guda_BankFrame_ClearHighlightedSlots()
</OnLeave>
</Scripts>
</Button>
<!-- Bank Bag Slot 9 -->
<Button name="$parent_BankBag9" inherits="ItemButtonTemplate">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_BankBag8">
<Offset>
<AbsDimension x="1" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
Guda_BankBagSlot_OnLoad(this, 9)
</OnLoad>
<OnEnter>
Guda_BankBagSlot_OnEnter(this, 9)
Guda_BankFrame_HighlightBagSlots(9)
</OnEnter>
<OnLeave>
GameTooltip:Hide()
Guda_BankFrame_ClearHighlightedSlots()
</OnLeave>
</Scripts>
</Button>
<!-- Bank Bag Slot 10 -->
<Button name="$parent_BankBag10" inherits="ItemButtonTemplate">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_BankBag9">
<Offset>
<AbsDimension x="1" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
Guda_BankBagSlot_OnLoad(this, 10)
</OnLoad>
<OnEnter>
Guda_BankBagSlot_OnEnter(this, 10)
Guda_BankFrame_HighlightBagSlots(10)
</OnEnter>
<OnLeave>
GameTooltip:Hide()
Guda_BankFrame_ClearHighlightedSlots()
</OnLeave>
</Scripts>
</Button>
<!-- Bank Slots Info Text -->
<Frame name="$parent_BankSlotsInfo">
<Size>
<AbsDimension x="100" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_BankBag10">
<Offset>
<AbsDimension x="8" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString name="$parent_Text" inherits="GameFontNormal">
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
local text = getglobal(this:GetName().."_Text")
if text then
text:SetText("0 / 0")
text:SetTextColor(0.8, 0.8, 0.8)
end
</OnLoad>
</Scripts>
</Frame>
</Frames>
</Frame>
<!-- Container for item buttons -->
<Frame name="$parent_ItemContainer" enableMouse="true">
<Size>
<AbsDimension x="400" y="480"/>
</Size>
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parent_SearchBar" x="0" y="-5"/>
</Anchors>
<Scripts>
<OnMouseDown>
-- Clear search focus when clicking in item area
local searchBox = getglobal("Guda_BankFrame_SearchBar_SearchBox")
if searchBox then
searchBox:ClearFocus()
end
</OnMouseDown>
<OnReceiveDrag>
-- Drop item into first available bank slot
if CursorHasItem and CursorHasItem() then
-- Try main bank slots (bag -1)
for slot = 1, GetContainerNumSlots(-1) do
if not GetContainerItemLink(-1, slot) then
PickupContainerItem(-1, slot)
break
end
end
-- Try bank bags 5-10
for bag = 5, 10 do
if CursorHasItem() then
for slot = 1, GetContainerNumSlots(bag) do
if not GetContainerItemLink(bag, slot) then
PickupContainerItem(bag, slot)
break
end
end
end
end
end
Guda_ClearCursorItem()
</OnReceiveDrag>
</Scripts>
</Frame>
</Frames>
<Scripts>
<OnLoad>
Guda_BankFrame_OnLoad(this)
</OnLoad>
<OnShow>
Guda_BankFrame_OnShow(this)
</OnShow>
<OnHide>
Guda_BankFrame_OnHide(this)
</OnHide>
<OnMouseDown>
-- Clear search box focus when clicking on bank frame
local searchBox = getglobal("Guda_BankFrame_SearchBar_SearchBox")
if searchBox then
searchBox:ClearFocus()
end
if (arg1 == "LeftButton") then
this:StartMoving()
end
</OnMouseDown>
<OnMouseUp>
this:StopMovingOrSizing()
</OnMouseUp>
<OnReceiveDrag>
-- Drop item into first available bank slot
if CursorHasItem and CursorHasItem() then
-- Try main bank slots (bag -1)
for slot = 1, GetContainerNumSlots(-1) do
if not GetContainerItemLink(-1, slot) then
PickupContainerItem(-1, slot)
break
end
end
-- Try bank bags 5-10
for bag = 5, 10 do
if CursorHasItem() then
for slot = 1, GetContainerNumSlots(bag) do
if not GetContainerItemLink(bag, slot) then
PickupContainerItem(bag, slot)
break
end
end
end
end
end
Guda_ClearCursorItem()
</OnReceiveDrag>
</Scripts>
</Frame>
</Ui>