fix: background transparency

This commit is contained in:
Salikh Gurgenidze
2025-12-21 21:15:44 +04:00
parent 0afaec6dfa
commit de9ac33ad7
9 changed files with 138 additions and 15 deletions
+9
View File
@@ -44,11 +44,20 @@ function DB:Initialize()
showSearchBar = true,
hoverBagline = false,
hideFooter = false,
bgTransparency = 0.15,
},
}
end
-- Ensure new settings exist for existing installations
if Guda_CharDB.settings.bgTransparency == nil then
if Guda_CharDB.settings.frameOpacity ~= nil then
Guda_CharDB.settings.bgTransparency = 1.0 - Guda_CharDB.settings.frameOpacity
Guda_CharDB.settings.frameOpacity = nil -- Clean up old setting
else
Guda_CharDB.settings.bgTransparency = 0.15
end
end
if Guda_CharDB.settings.hideFooter == nil then
Guda_CharDB.settings.hideFooter = false
end
+18 -7
View File
@@ -57,27 +57,27 @@ addon.Constants = {
Backdrops = {
-- Standard frame backdrop (used for main windows)
DEFAULT_FRAME = {
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
tile = true,
tileSize = 32,
tileSize = 16,
edgeSize = 32,
insets = { left = 11, right = 12, top = 12, bottom = 11 }
},
-- Minimalist border (used when "hide borders" setting is enabled)
MINIMALIST_BORDER = {
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true,
tileSize = 32,
tileSize = 16,
edgeSize = 2,
insets = { left = 0, right = 0, top = 0, bottom = 0 }
},
-- Dropdown/popup backdrop (used for character selection dropdowns)
DROPDOWN = {
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
tile = true,
tileSize = 16,
@@ -88,7 +88,7 @@ addon.Constants = {
-- Backdrop colors (common configurations)
BackdropColors = {
DEFAULT = {r = 0, g = 0, b = 0, a = 0.9},
DEFAULT = {r = 0, g = 0, b = 0, a = 0.85},
DROPDOWN = {r = 0, g = 0, b = 0, a = 0.95},
},
}
@@ -196,7 +196,18 @@ function addon:ApplyBackdrop(frame, backdropType, colorType)
end
frame:SetBackdrop(backdrop)
frame:SetBackdropColor(color.r, color.g, color.b, color.a)
-- If it's a main frame, we should respect the transparency setting
local frameName = frame:GetName()
if frameName == "Guda_BagFrame" or frameName == "Guda_BankFrame" or frameName == "Guda_SettingsPopup" or frameName == "Guda_QuestItemBar" then
if Guda_ApplyBackgroundTransparency then
Guda_ApplyBackgroundTransparency()
else
frame:SetBackdropColor(color.r, color.g, color.b, color.a)
end
else
frame:SetBackdropColor(color.r, color.g, color.b, color.a)
end
-- Set border color to white for minimalist borders
if backdropType == "MINIMALIST_BORDER" then
+5
View File
@@ -43,6 +43,11 @@ function Main:Initialize()
addon.Modules.SettingsPopup:Initialize()
-- Apply initial transparency settings
if Guda_ApplyBackgroundTransparency then
Guda_ApplyBackgroundTransparency()
end
-- Initialize tooltip
if addon.Modules.Tooltip then
addon.Modules.Tooltip:Initialize()