styles updated

This commit is contained in:
Salikh Gurgenidze
2025-11-16 05:25:55 +04:00
parent aec33e3652
commit baf01058f0
8 changed files with 278 additions and 64 deletions
+6 -6
View File
@@ -100,7 +100,7 @@ function BagFrame:Update()
local isOtherChar = false
local charName = ""
local titleFont = getglobal("Guda_BagFrame_Toolbar_Title")
local titleFont = getglobal("Guda_BagFrame_Title")
local displayName
if currentViewChar then
@@ -138,7 +138,7 @@ function BagFrame:DisplayItems(bagData, isOtherChar, charName)
local row = 0
local col = 0
local buttonSize = addon.Modules.DB:GetSetting("iconSize") or addon.Constants.BUTTON_SIZE
local spacing = addon.Constants.BUTTON_SPACING
local spacing = addon.Modules.DB:GetSetting("iconSpacing") or addon.Constants.BUTTON_SPACING
local perRow = addon.Modules.DB:GetSetting("bagColumns") or 10
local itemContainer = getglobal("Guda_BagFrame_ItemContainer")
@@ -188,7 +188,7 @@ end
-- Resize frame based on number of rows and columns
function BagFrame:ResizeFrame(currentRow, currentCol, columns)
local buttonSize = addon.Modules.DB:GetSetting("iconSize") or addon.Constants.BUTTON_SIZE
local spacing = addon.Constants.BUTTON_SPACING
local spacing = addon.Modules.DB:GetSetting("iconSpacing") or addon.Constants.BUTTON_SPACING
-- Calculate actual number of rows used
local totalRows = currentRow + 1
@@ -202,7 +202,7 @@ function BagFrame:ResizeFrame(currentRow, currentCol, columns)
local containerWidth = (columns * (buttonSize + spacing)) + 20
local containerHeight = (totalRows * (buttonSize + spacing)) + 20
local frameWidth = containerWidth + 30
local frameHeight = containerHeight + 160
local frameHeight = containerHeight + 100 -- Title (40) + search (30) + footer (30)
-- Minimum sizes
if containerWidth < 200 then
@@ -212,8 +212,8 @@ function BagFrame:ResizeFrame(currentRow, currentCol, columns)
if containerHeight < 150 then
containerHeight = 150
end
if frameHeight < 350 then
frameHeight = 350
if frameHeight < 250 then
frameHeight = 250
end
-- Maximum sizes
+156 -40
View File
@@ -27,16 +27,30 @@
<Color r="0" g="0" b="0" a="0.9"/>
</Backdrop>
<!-- Keep a (currently unused) top-level layer block for future use -->
<Layers>
<Layer level="BACKGROUND"/>
<!-- 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" x="-5" y="-5"/>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-10" y="-10"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
@@ -45,13 +59,17 @@
</Scripts>
</Button>
<!-- Toolbar Container (top row) -->
<!-- Toolbar Container (moved to footer) -->
<Frame name="$parent_Toolbar" enableMouse="true">
<Size>
<AbsDimension x="400" y="30"/>
<AbsDimension x="200" y="30"/>
</Size>
<Anchors>
<Anchor point="TOP" x="0" y="-10"/>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="20" y="20"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnMouseDown>
@@ -63,33 +81,46 @@
</OnMouseDown>
</Scripts>
<!-- Title centered in toolbar -->
<Layers>
<Layer level="ARTWORK">
<FontString name="$parent_Title" inherits="GameFontNormalLarge">
<Anchors>
<Anchor point="CENTER" x="0" y="0"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<!-- Sort Button -->
<!-- Sort Button (icon-based) -->
<Button name="$parent_SortButton">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" x="10" y="0"/>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<NormalTexture file="Interface\\Icons\\INV_Misc_Note_01"/>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parent_Icon">
<Size>
<AbsDimension x="20" y="20"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Color r="0.8" g="0.8" b="0.8"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
-- Placeholder: Set texture file path here
local icon = getglobal(this:GetName().."_Icon")
if icon then
icon:SetTexture("Interface\\Icons\\INV_Misc_Note_01")
icon:SetTexCoord(0.08, 0.92, 0.08, 0.92)
end
</OnLoad>
<OnClick>
Guda_BagFrame_Sort()
</OnClick>
<OnEnter>
GameTooltip:SetOwner(this, "ANCHOR_RIGHT")
GameTooltip:SetOwner(this, "ANCHOR_TOP")
GameTooltip:SetText("Sort Bags")
GameTooltip:Show()
</OnEnter>
@@ -99,21 +130,44 @@
</Scripts>
</Button>
<!-- Characters Button -->
<!-- Characters Button (icon-based) -->
<Button name="$parent_CharsButton">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_SortButton" x="5" y="0"/>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_SortButton">
<Offset>
<AbsDimension x="4" y="0"/>
</Offset>
</Anchor>
</Anchors>
<NormalTexture file="Interface\\Icons\\INV_Misc_GroupNeedMore"/>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parent_Icon">
<Size>
<AbsDimension x="20" y="20"/>
</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\\Icons\\INV_Misc_GroupNeedMore")
icon:SetTexCoord(0.08, 0.92, 0.08, 0.92)
end
</OnLoad>
<OnClick>
Guda_CharacterSelector:Toggle()
</OnClick>
<OnEnter>
GameTooltip:SetOwner(this, "ANCHOR_RIGHT")
GameTooltip:SetOwner(this, "ANCHOR_TOP")
GameTooltip:SetText("View Other Characters")
GameTooltip:Show()
</OnEnter>
@@ -123,21 +177,44 @@
</Scripts>
</Button>
<!-- Bank Button -->
<!-- Bank Button (icon-based) -->
<Button name="$parent_BankButton">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_CharsButton" x="5" y="0"/>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_CharsButton">
<Offset>
<AbsDimension x="4" y="0"/>
</Offset>
</Anchor>
</Anchors>
<NormalTexture file="Interface\\Icons\\INV_Misc_Bag_09"/>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parent_Icon">
<Size>
<AbsDimension x="20" y="20"/>
</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\\Icons\\INV_Misc_Bag_09")
icon:SetTexCoord(0.08, 0.92, 0.08, 0.92)
end
</OnLoad>
<OnClick>
Guda_BankFrame:Toggle()
</OnClick>
<OnEnter>
GameTooltip:SetOwner(this, "ANCHOR_RIGHT")
GameTooltip:SetOwner(this, "ANCHOR_TOP")
GameTooltip:SetText("View Bank")
GameTooltip:Show()
</OnEnter>
@@ -147,21 +224,44 @@
</Scripts>
</Button>
<!-- Settings Button -->
<!-- Settings Button (icon-based) -->
<Button name="$parent_SettingsButton">
<Size>
<AbsDimension x="24" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_BankButton" x="5" y="0"/>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_BankButton">
<Offset>
<AbsDimension x="4" y="0"/>
</Offset>
</Anchor>
</Anchors>
<NormalTexture file="Interface\\Icons\\Trade_Engineering"/>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parent_Icon">
<Size>
<AbsDimension x="20" y="20"/>
</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\\Icons\\Trade_Engineering")
icon:SetTexCoord(0.08, 0.92, 0.08, 0.92)
end
</OnLoad>
<OnClick>
Guda_OpenSettings()
</OnClick>
<OnEnter>
GameTooltip:SetOwner(this, "ANCHOR_RIGHT")
GameTooltip:SetOwner(this, "ANCHOR_TOP")
GameTooltip:SetText("Settings")
GameTooltip:Show()
</OnEnter>
@@ -173,13 +273,17 @@
</Frames>
</Frame>
<!-- Search Bar (second row) -->
<!-- Search Bar (now below title) -->
<Frame name="$parent_SearchBar">
<Size>
<AbsDimension x="400" y="30"/>
</Size>
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parent_Toolbar" x="0" y="-5"/>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-40"/>
</Offset>
</Anchor>
</Anchors>
<Frames>
@@ -189,8 +293,16 @@
<AbsDimension x="0" y="20"/>
</Size>
<Anchors>
<Anchor point="LEFT" x="10" y="0"/>
<Anchor point="RIGHT" x="-10" y="0"/>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="15" y="0"/>
</Offset>
</Anchor>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="-10" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnEditFocusGained>
@@ -228,13 +340,17 @@
</Frames>
</Frame>
<!-- Money Display Frame -->
<!-- Money Display Frame (moved to bottom right) -->
<Frame name="$parent_MoneyFrame" enableMouse="true">
<Size>
<AbsDimension x="300" y="30"/>
<AbsDimension x="150" y="30"/>
</Size>
<Anchors>
<Anchor point="BOTTOM" x="0" y="10"/>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-10" y="10"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnMouseDown>
+5 -5
View File
@@ -84,7 +84,7 @@ function BankFrame:DisplayItems(bankData, isOtherChar, charName)
local row = 0
local col = 0
local buttonSize = addon.Modules.DB:GetSetting("iconSize") or addon.Constants.BUTTON_SIZE
local spacing = addon.Constants.BUTTON_SPACING
local spacing = addon.Modules.DB:GetSetting("iconSpacing") or addon.Constants.BUTTON_SPACING
local perRow = addon.Modules.DB:GetSetting("bankColumns") or 15
local itemContainer = getglobal("Guda_BankFrame_ItemContainer")
@@ -121,7 +121,7 @@ end
-- Resize bank frame based on number of rows and columns
function BankFrame:ResizeFrame(currentRow, currentCol, columns)
local buttonSize = addon.Modules.DB:GetSetting("iconSize") or addon.Constants.BUTTON_SIZE
local spacing = addon.Constants.BUTTON_SPACING
local spacing = addon.Modules.DB:GetSetting("iconSpacing") or addon.Constants.BUTTON_SPACING
-- Calculate actual number of rows used
local totalRows = currentRow + 1
@@ -138,7 +138,7 @@ function BankFrame:ResizeFrame(currentRow, currentCol, columns)
local containerWidth = (columns * (buttonSize + spacing)) + 20
local containerHeight = (totalRows * (buttonSize + spacing)) + 20
local frameWidth = containerWidth + 30
local frameHeight = containerHeight + 120
local frameHeight = containerHeight + 100 -- Title (40) + search (30) + footer (30)
-- Minimum sizes
if containerWidth < 200 then
@@ -148,8 +148,8 @@ function BankFrame:ResizeFrame(currentRow, currentCol, columns)
if containerHeight < 150 then
containerHeight = 150
end
if frameHeight < 350 then
frameHeight = 350
if frameHeight < 250 then
frameHeight = 250
end
-- Maximum sizes
+15 -3
View File
@@ -31,7 +31,11 @@
<Layer level="ARTWORK">
<FontString name="$parent_Title" inherits="GameFontNormalLarge">
<Anchors>
<Anchor point="TOP" x="0" y="-15"/>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-18"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
@@ -41,7 +45,11 @@
<!-- Close Button -->
<Button name="$parent_CloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT" x="-5" y="-5"/>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-10" y="-10"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
@@ -80,7 +88,11 @@
<AbsDimension x="200" y="20"/>
</Size>
<Anchors>
<Anchor point="TOP" x="0" y="-45"/>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-48"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnTextChanged>
+8 -5
View File
@@ -129,9 +129,10 @@ function Guda_ItemButton_SetItem(self, bagID, slotID, itemData, isBank, otherCha
normalBorder:SetTexture("")
end
-- Hide empty slot background for filled slots
-- Show bag pattern background behind items as well
if emptySlotBg then
emptySlotBg:Hide()
emptySlotBg:Show()
emptySlotBg:SetAlpha(0.3) -- More subtle for filled slots
end
-- Search filtering (pfUI style - ONLY use alpha, no other effects)
@@ -203,10 +204,12 @@ function Guda_ItemButton_SetItem(self, bagID, slotID, itemData, isBank, otherCha
if iconTexture then
if self.hasItem then
-- pfUI style: anchor to fill the button with small insets
-- Make icon 3px smaller than slot for nice inset effect
local iconDisplaySize = iconSize - 15
iconTexture:ClearAllPoints()
iconTexture:SetPoint("TOPLEFT", self, "TOPLEFT", 1, -1)
iconTexture:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -1, 1)
iconTexture:SetPoint("CENTER", self, "CENTER", 0, 0)
iconTexture:SetWidth(iconDisplaySize)
iconTexture:SetHeight(iconDisplaySize)
-- Crop icon edges slightly (pfUI uses .08 to .92)
iconTexture:SetTexCoord(0.08, 0.92, 0.08, 0.92)
iconTexture:Show()
+5 -1
View File
@@ -31,7 +31,11 @@
<Layer level="OVERLAY">
<FontString name="$parent_Count" inherits="NumberFontNormal" justifyH="RIGHT">
<Anchors>
<Anchor point="BOTTOMRIGHT" x="-2" y="2"/>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-8" y="8"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
+49
View File
@@ -33,6 +33,7 @@ function Guda_SettingsPopup_OnShow(self)
local bankColumns = Guda.Modules.DB:GetSetting("bankColumns") or 15
local iconSize = Guda.Modules.DB:GetSetting("iconSize") or addon.Constants.BUTTON_SIZE
local iconFontSize = Guda.Modules.DB:GetSetting("iconFontSize") or 12
local iconSpacing = Guda.Modules.DB:GetSetting("iconSpacing") or 4
local lockBags = Guda.Modules.DB:GetSetting("lockBags")
if lockBags == nil then
lockBags = false
@@ -43,6 +44,7 @@ function Guda_SettingsPopup_OnShow(self)
local bankSlider = getglobal("Guda_SettingsPopup_BankColumnsSlider")
local iconSizeSlider = getglobal("Guda_SettingsPopup_IconSizeSlider")
local iconFontSizeSlider = getglobal("Guda_SettingsPopup_IconFontSizeSlider")
local iconSpacingSlider = getglobal("Guda_SettingsPopup_IconSpacingSlider")
local lockCheckbox = getglobal("Guda_SettingsPopup_LockBagsCheckbox")
if bagSlider then
@@ -61,6 +63,10 @@ function Guda_SettingsPopup_OnShow(self)
iconFontSizeSlider:SetValue(iconFontSize)
end
if iconSpacingSlider then
iconSpacingSlider:SetValue(iconSpacing)
end
if lockCheckbox then
lockCheckbox:SetChecked(lockBags and 1 or 0)
end
@@ -234,6 +240,49 @@ function Guda_SettingsPopup_IconFontSizeSlider_OnValueChanged(self)
end
end
-- Icon Spacing Slider OnLoad
function Guda_SettingsPopup_IconSpacingSlider_OnLoad(self)
getglobal(self:GetName().."Low"):SetText("-5px")
getglobal(self:GetName().."High"):SetText("10px")
local text = getglobal(self:GetName().."Text")
text:SetText("Icon spacing")
-- Increase font size
local font, _, flags = text:GetFont()
if font then
text:SetFont(font, 12, flags)
end
self:SetMinMaxValues(-5, 10)
self:SetValueStep(1)
local currentValue = Guda.Modules.DB:GetSetting("iconSpacing") or 4
self:SetValue(currentValue)
end
-- Icon Spacing Slider OnValueChanged
function Guda_SettingsPopup_IconSpacingSlider_OnValueChanged(self)
local value = math.floor(self:GetValue() + 0.5)
local displayValue = value >= 0 and value .. "px" or value .. "px"
getglobal(self:GetName().."Text"):SetText("Icon spacing: " .. displayValue)
-- Save setting
Guda.Modules.DB:SetSetting("iconSpacing", value)
-- Update bag frame
local bagFrame = getglobal("Guda_BagFrame")
if bagFrame and bagFrame:IsShown() then
Guda.Modules.BagFrame:Update()
end
-- Update bank frame
local bankFrame = getglobal("Guda_BankFrame")
if bankFrame and bankFrame:IsShown() then
Guda.Modules.BankFrame:Update()
end
end
-- Lock Bags Checkbox OnLoad
function Guda_SettingsPopup_LockBagsCheckbox_OnLoad(self)
local text = getglobal(self:GetName().."Text")
+34 -4
View File
@@ -3,7 +3,7 @@
<!-- Settings Popup Frame -->
<Frame name="Guda_SettingsPopup" toplevel="true" movable="true" enableMouse="true" hidden="true" parent="UIParent" frameStrata="DIALOG">
<Size>
<AbsDimension x="320" y="380"/>
<AbsDimension x="320" y="420"/>
</Size>
<Anchors>
@@ -32,7 +32,11 @@
<Layer level="ARTWORK">
<FontString name="$parent_Title" inherits="GameFontNormalLarge">
<Anchors>
<Anchor point="TOP" x="0" y="-25"/>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-18"/>
</Offset>
</Anchor>
</Anchors>
<Color r="1" g="0.82" b="0"/>
</FontString>
@@ -43,7 +47,11 @@
<!-- Close Button -->
<Button name="$parent_CloseButton" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT" x="-5" y="-50"/>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-10" y="-10"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
@@ -140,10 +148,32 @@
</Scripts>
</Slider>
<!-- Icon Spacing Slider -->
<Slider name="$parent_IconSpacingSlider" inherits="OptionsSliderTemplate">
<Size>
<AbsDimension x="270" y="17"/>
</Size>
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parent_IconFontSizeSlider">
<Offset>
<AbsDimension x="0" y="-40"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
Guda_SettingsPopup_IconSpacingSlider_OnLoad(this)
</OnLoad>
<OnValueChanged>
Guda_SettingsPopup_IconSpacingSlider_OnValueChanged(this)
</OnValueChanged>
</Scripts>
</Slider>
<!-- Lock Bags Checkbox -->
<CheckButton name="$parent_LockBagsCheckbox" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parent_IconFontSizeSlider">
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parent_IconSpacingSlider">
<Offset>
<AbsDimension x="-120" y="-30"/>
</Offset>