blizzard theme ui

This commit is contained in:
Vati
2026-02-27 04:11:46 +04:00
parent b07ea69994
commit 8e73db855d
14 changed files with 548 additions and 113 deletions
+6
View File
@@ -2352,6 +2352,12 @@ function BagFrame:UpdateBorderVisibility()
local frame = getglobal("Guda_BagFrame")
if not frame then return end
-- Use Theme module if available
if addon.Modules.Theme then
addon.Modules.Theme:ApplyToFrame(frame)
return
end
local hideBorders = addon.Modules.DB:GetSetting("hideBorders")
if hideBorders == nil then
hideBorders = false
-12
View File
@@ -15,18 +15,6 @@
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\ChatFrame\ChatFrameBackground" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<EdgeSize>
<AbsValue val="32"/>
</EdgeSize>
</Backdrop>
<Layers>
<!-- Title at top -->
<Layer level="ARTWORK">
+6
View File
@@ -1886,6 +1886,12 @@ function BankFrame:UpdateBorderVisibility()
local frame = getglobal("Guda_BankFrame")
if not frame then return end
-- Use Theme module if available
if addon.Modules.Theme then
addon.Modules.Theme:ApplyToFrame(frame)
return
end
local hideBorders = addon.Modules.DB:GetSetting("hideBorders")
if hideBorders == nil then
hideBorders = false
-12
View File
@@ -15,18 +15,6 @@
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\ChatFrame\ChatFrameBackground" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<EdgeSize>
<AbsValue val="32"/>
</EdgeSize>
</Backdrop>
<Layers>
<!-- Title at top -->
<Layer level="ARTWORK">
+33 -6
View File
@@ -918,8 +918,17 @@ local function ClearItemButton(self, emptySlotBg, countText, bagID)
-- Show/hide empty slot background
if emptySlotBg then
emptySlotBg:Show()
emptySlotBg:SetAlpha(0.5)
local slotAlpha = 0.5
if addon.Modules and addon.Modules.Theme then
local sa = addon.Modules.Theme:GetValue("slotBgAlpha")
if sa then slotAlpha = sa.empty end
end
if slotAlpha > 0 then
emptySlotBg:Show()
emptySlotBg:SetAlpha(slotAlpha)
else
emptySlotBg:Hide()
end
end
if countText then countText:Hide() end
@@ -1215,8 +1224,17 @@ function Guda_ItemButton_SetItem(self, bagID, slotID, itemData, isBank, otherCha
-- Show bag pattern background behind items as well
if emptySlotBg then
emptySlotBg:Show()
emptySlotBg:SetAlpha(0.3) -- More subtle for filled slots
local slotAlpha = 0.3
if addon.Modules and addon.Modules.Theme then
local sa = addon.Modules.Theme:GetValue("slotBgAlpha")
if sa then slotAlpha = sa.filled end
end
if slotAlpha > 0 then
emptySlotBg:Show()
emptySlotBg:SetAlpha(slotAlpha)
else
emptySlotBg:Hide()
end
end
-- Check if item is junk using the CategoryManager
@@ -1346,8 +1364,17 @@ function Guda_ItemButton_SetItem(self, bagID, slotID, itemData, isBank, otherCha
-- Show classic bag pattern background for empty slots
if emptySlotBg then
emptySlotBg:Show()
emptySlotBg:SetAlpha(0.5) -- Slightly more visible
local slotAlpha = 0.5
if addon.Modules and addon.Modules.Theme then
local sa = addon.Modules.Theme:GetValue("slotBgAlpha")
if sa then slotAlpha = sa.empty end
end
if slotAlpha > 0 then
emptySlotBg:Show()
emptySlotBg:SetAlpha(slotAlpha)
else
emptySlotBg:Hide()
end
end
-- Dim empty slots when searching
+6
View File
@@ -73,6 +73,12 @@ end
-- Update border visibility
function MailboxFrame:UpdateBorderVisibility()
-- Use Theme module if available
if addon.Modules and addon.Modules.Theme then
addon.Modules.Theme:ApplyToFrame(Guda_MailboxFrame)
return
end
local hideBorders = addon.Modules.DB:GetSetting("hideBorders")
if hideBorders then
Guda:ApplyBackdrop(Guda_MailboxFrame, "MINIMALIST_BORDER", "DEFAULT")
-12
View File
@@ -91,18 +91,6 @@
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\ChatFrame\ChatFrameBackground" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<EdgeSize>
<AbsValue val="32"/>
</EdgeSize>
</Backdrop>
<Layers>
<!-- Title at top -->
<Layer level="ARTWORK">
+54 -32
View File
@@ -151,6 +151,7 @@ function Guda_SettingsPopup_OnShow(self)
local showTooltipCountsCheckbox = getglobal("Guda_SettingsPopup_ShowTooltipCountsCheckbox")
local bagViewButton = getglobal("Guda_SettingsPopup_BagViewTypeButton")
local bankViewButton = getglobal("Guda_SettingsPopup_BankViewTypeButton")
local themeButton = getglobal("Guda_SettingsPopup_ThemeButton")
local showTooltipCounts = Guda.Modules.DB:GetSetting("showTooltipCounts")
if showTooltipCounts == nil then
@@ -241,7 +242,11 @@ function Guda_SettingsPopup_OnShow(self)
end
end
-- Initialize theme button text
if themeButton then
local currentTheme = Guda.Modules.DB:GetSetting("theme") or "guda"
themeButton:SetText(currentTheme == "guda" and "Theme: Guda" or "Theme: Blizzard")
end
-- Apply border visibility
if SettingsPopup.UpdateBorderVisibility then
@@ -395,16 +400,21 @@ end
-- Apply background transparency to bag and bank frames
function Guda_ApplyBackgroundTransparency()
-- If Theme module is available, delegate to it (handles both themes correctly)
if Guda.Modules and Guda.Modules.Theme then
Guda.Modules.Theme:ApplyToAllFrames()
return
end
-- Fallback: original behavior
local transparency = Guda.Modules.DB:GetSetting("bgTransparency") or 0.15
local alpha = 1.0 - transparency
local frames = { "Guda_BagFrame", "Guda_BankFrame", "Guda_MailboxFrame", "Guda_SettingsPopup", "Guda_QuestItemBar" }
for _, frameName in ipairs(frames) do
local frame = getglobal(frameName)
if frame then
-- Reset frame alpha to 1.0 (previous version might have set it)
frame:SetAlpha(1.0)
-- Set backdrop color (background only)
frame:SetBackdropColor(0, 0, 0, alpha)
end
end
@@ -684,37 +694,26 @@ function Guda_SettingsPopup_HideBordersCheckbox_OnClick(self)
Guda.Modules.DB:SetSetting("hideBorders", isChecked)
end
-- Update border visibility on both bag and bank frames using helper function
local bagFrame = getglobal("Guda_BagFrame")
if bagFrame then
if isChecked then
Guda:ApplyBackdrop(bagFrame, "MINIMALIST_BORDER", "DEFAULT")
else
Guda:ApplyBackdrop(bagFrame, "DEFAULT_FRAME", "DEFAULT")
-- Apply theme to all frames (respects hideBorders setting)
if Guda.Modules and Guda.Modules.Theme then
Guda.Modules.Theme:ApplyToAllFrames()
else
-- Fallback if theme module not loaded
local bagFrame = getglobal("Guda_BagFrame")
if bagFrame then
Guda:ApplyBackdrop(bagFrame, isChecked and "MINIMALIST_BORDER" or "DEFAULT_FRAME", "DEFAULT")
end
end
local bankFrame = getglobal("Guda_BankFrame")
if bankFrame then
if isChecked then
Guda:ApplyBackdrop(bankFrame, "MINIMALIST_BORDER", "DEFAULT")
else
Guda:ApplyBackdrop(bankFrame, "DEFAULT_FRAME", "DEFAULT")
local bankFrame = getglobal("Guda_BankFrame")
if bankFrame then
Guda:ApplyBackdrop(bankFrame, isChecked and "MINIMALIST_BORDER" or "DEFAULT_FRAME", "DEFAULT")
end
end
local mailboxFrame = getglobal("Guda_MailboxFrame")
if mailboxFrame then
if isChecked then
Guda:ApplyBackdrop(mailboxFrame, "MINIMALIST_BORDER", "DEFAULT")
else
Guda:ApplyBackdrop(mailboxFrame, "DEFAULT_FRAME", "DEFAULT")
local mailboxFrame = getglobal("Guda_MailboxFrame")
if mailboxFrame then
Guda:ApplyBackdrop(mailboxFrame, isChecked and "MINIMALIST_BORDER" or "DEFAULT_FRAME", "DEFAULT")
end
if SettingsPopup.UpdateBorderVisibility then
SettingsPopup:UpdateBorderVisibility()
end
end
-- Update border visibility on settings frame
if SettingsPopup.UpdateBorderVisibility then
SettingsPopup:UpdateBorderVisibility()
end
end
@@ -1142,6 +1141,29 @@ function Guda_SettingsPopup_MarkUnusableCheckbox_OnClick(self)
end
end
-- Theme Button OnClick
function Guda_SettingsPopup_ThemeButton_OnClick()
local current = Guda.Modules.DB:GetSetting("theme") or "guda"
local newValue = (current == "guda") and "blizzard" or "guda"
Guda.Modules.DB:SetSetting("theme", newValue)
-- Clear theme cache
if Guda.Modules.Theme then
Guda.Modules.Theme:ClearCache()
end
-- Update button text
local btn = getglobal("Guda_SettingsPopup_ThemeButton")
if btn then
btn:SetText(newValue == "guda" and "Theme: Guda" or "Theme: Blizzard")
end
-- Apply theme to all frames (also updates slot background alphas)
if Guda.Modules.Theme then
Guda.Modules.Theme:ApplyToAllFrames()
end
end
-- Bag View Type Button OnClick
function Guda_SettingsPopup_BagViewTypeButton_OnClick()
local current = Guda.Modules.DB:GetSetting("bagViewType") or "single"
+15 -26
View File
@@ -14,18 +14,6 @@
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="32"/>
</TileSize>
<EdgeSize>
<AbsValue val="32"/>
</EdgeSize>
</Backdrop>
<Layers>
<!-- Title -->
<Layer level="ARTWORK">
@@ -203,15 +191,28 @@
</Anchor>
</Anchors>
<Frames>
<!-- Theme Toggle Button -->
<Button name="Guda_SettingsPopup_ThemeButton" inherits="UIPanelButtonTemplate">
<Size><AbsDimension x="180" y="25"/></Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset><AbsDimension x="5" y="-15"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>Guda_SettingsPopup_ThemeButton_OnClick()</OnClick>
</Scripts>
</Button>
<!-- Bag Columns Slider -->
<Slider name="Guda_SettingsPopup_BagColumnsSlider" inherits="OptionsSliderTemplate">
<Size>
<AbsDimension x="450" y="17"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="Guda_SettingsPopup_ThemeButton">
<Offset>
<AbsDimension x="5" y="-40"/>
<AbsDimension x="0" y="-25"/>
</Offset>
</Anchor>
</Anchors>
@@ -819,18 +820,6 @@
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="32"/>
</TileSize>
<EdgeSize>
<AbsValue val="32"/>
</EdgeSize>
</Backdrop>
<Layers>
<Layer level="ARTWORK">
<!-- Title -->