fix: background transparency
This commit is contained in:
@@ -44,11 +44,20 @@ function DB:Initialize()
|
|||||||
showSearchBar = true,
|
showSearchBar = true,
|
||||||
hoverBagline = false,
|
hoverBagline = false,
|
||||||
hideFooter = false,
|
hideFooter = false,
|
||||||
|
bgTransparency = 0.15,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Ensure new settings exist for existing installations
|
-- 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
|
if Guda_CharDB.settings.hideFooter == nil then
|
||||||
Guda_CharDB.settings.hideFooter = false
|
Guda_CharDB.settings.hideFooter = false
|
||||||
end
|
end
|
||||||
|
|||||||
+18
-7
@@ -57,27 +57,27 @@ addon.Constants = {
|
|||||||
Backdrops = {
|
Backdrops = {
|
||||||
-- Standard frame backdrop (used for main windows)
|
-- Standard frame backdrop (used for main windows)
|
||||||
DEFAULT_FRAME = {
|
DEFAULT_FRAME = {
|
||||||
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
|
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
|
||||||
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
|
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
|
||||||
tile = true,
|
tile = true,
|
||||||
tileSize = 32,
|
tileSize = 16,
|
||||||
edgeSize = 32,
|
edgeSize = 32,
|
||||||
insets = { left = 11, right = 12, top = 12, bottom = 11 }
|
insets = { left = 11, right = 12, top = 12, bottom = 11 }
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Minimalist border (used when "hide borders" setting is enabled)
|
-- Minimalist border (used when "hide borders" setting is enabled)
|
||||||
MINIMALIST_BORDER = {
|
MINIMALIST_BORDER = {
|
||||||
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
|
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
|
||||||
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
|
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
|
||||||
tile = true,
|
tile = true,
|
||||||
tileSize = 32,
|
tileSize = 16,
|
||||||
edgeSize = 2,
|
edgeSize = 2,
|
||||||
insets = { left = 0, right = 0, top = 0, bottom = 0 }
|
insets = { left = 0, right = 0, top = 0, bottom = 0 }
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Dropdown/popup backdrop (used for character selection dropdowns)
|
-- Dropdown/popup backdrop (used for character selection dropdowns)
|
||||||
DROPDOWN = {
|
DROPDOWN = {
|
||||||
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
|
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
|
||||||
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
|
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
|
||||||
tile = true,
|
tile = true,
|
||||||
tileSize = 16,
|
tileSize = 16,
|
||||||
@@ -88,7 +88,7 @@ addon.Constants = {
|
|||||||
|
|
||||||
-- Backdrop colors (common configurations)
|
-- Backdrop colors (common configurations)
|
||||||
BackdropColors = {
|
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},
|
DROPDOWN = {r = 0, g = 0, b = 0, a = 0.95},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -196,7 +196,18 @@ function addon:ApplyBackdrop(frame, backdropType, colorType)
|
|||||||
end
|
end
|
||||||
|
|
||||||
frame:SetBackdrop(backdrop)
|
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
|
-- Set border color to white for minimalist borders
|
||||||
if backdropType == "MINIMALIST_BORDER" then
|
if backdropType == "MINIMALIST_BORDER" then
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ function Main:Initialize()
|
|||||||
|
|
||||||
addon.Modules.SettingsPopup:Initialize()
|
addon.Modules.SettingsPopup:Initialize()
|
||||||
|
|
||||||
|
-- Apply initial transparency settings
|
||||||
|
if Guda_ApplyBackgroundTransparency then
|
||||||
|
Guda_ApplyBackgroundTransparency()
|
||||||
|
end
|
||||||
|
|
||||||
-- Initialize tooltip
|
-- Initialize tooltip
|
||||||
if addon.Modules.Tooltip then
|
if addon.Modules.Tooltip then
|
||||||
addon.Modules.Tooltip:Initialize()
|
addon.Modules.Tooltip:Initialize()
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ end
|
|||||||
|
|
||||||
-- OnLoad
|
-- OnLoad
|
||||||
function Guda_BagFrame_OnLoad(self)
|
function Guda_BagFrame_OnLoad(self)
|
||||||
|
-- Set up initial backdrop
|
||||||
|
addon:ApplyBackdrop(self, "DEFAULT_FRAME")
|
||||||
|
|
||||||
-- Set up search box placeholder
|
-- Set up search box placeholder
|
||||||
local searchBox = getglobal(self:GetName().."_SearchBar_SearchBox")
|
local searchBox = getglobal(self:GetName().."_SearchBar_SearchBox")
|
||||||
if searchBox then
|
if searchBox then
|
||||||
@@ -96,6 +99,11 @@ function Guda_BagFrame_OnShow(self)
|
|||||||
BagFrame:UpdateFooterVisibility()
|
BagFrame:UpdateFooterVisibility()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Apply frame transparency
|
||||||
|
if Guda_ApplyBackgroundTransparency then
|
||||||
|
Guda_ApplyBackgroundTransparency()
|
||||||
|
end
|
||||||
|
|
||||||
BagFrame:Update()
|
BagFrame:Update()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -15,7 +15,7 @@
|
|||||||
</Anchor>
|
</Anchor>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
|
|
||||||
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
|
<Backdrop bgFile="Interface\ChatFrame\ChatFrameBackground" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
|
||||||
<BackgroundInsets>
|
<BackgroundInsets>
|
||||||
<AbsInset left="11" right="12" top="12" bottom="11"/>
|
<AbsInset left="11" right="12" top="12" bottom="11"/>
|
||||||
</BackgroundInsets>
|
</BackgroundInsets>
|
||||||
@@ -25,7 +25,6 @@
|
|||||||
<EdgeSize>
|
<EdgeSize>
|
||||||
<AbsValue val="32"/>
|
<AbsValue val="32"/>
|
||||||
</EdgeSize>
|
</EdgeSize>
|
||||||
<Color r="0" g="0" b="0" a="0.9"/>
|
|
||||||
</Backdrop>
|
</Backdrop>
|
||||||
|
|
||||||
<Layers>
|
<Layers>
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ local bankClickCatcher = nil
|
|||||||
|
|
||||||
-- OnLoad
|
-- OnLoad
|
||||||
function Guda_BankFrame_OnLoad(self)
|
function Guda_BankFrame_OnLoad(self)
|
||||||
|
-- Set up initial backdrop
|
||||||
|
addon:ApplyBackdrop(self, "DEFAULT_FRAME")
|
||||||
|
|
||||||
-- Set up search box placeholder
|
-- Set up search box placeholder
|
||||||
local searchBox = getglobal(self:GetName().."_SearchBar_SearchBox")
|
local searchBox = getglobal(self:GetName().."_SearchBar_SearchBox")
|
||||||
if searchBox then
|
if searchBox then
|
||||||
@@ -67,6 +70,11 @@ function Guda_BankFrame_OnShow(self)
|
|||||||
BankFrame:UpdateFooterVisibility()
|
BankFrame:UpdateFooterVisibility()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Apply frame transparency
|
||||||
|
if Guda_ApplyBackgroundTransparency then
|
||||||
|
Guda_ApplyBackgroundTransparency()
|
||||||
|
end
|
||||||
|
|
||||||
BankFrame:Update()
|
BankFrame:Update()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -15,7 +15,7 @@
|
|||||||
</Anchor>
|
</Anchor>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
|
|
||||||
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
|
<Backdrop bgFile="Interface\ChatFrame\ChatFrameBackground" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
|
||||||
<BackgroundInsets>
|
<BackgroundInsets>
|
||||||
<AbsInset left="11" right="12" top="12" bottom="11"/>
|
<AbsInset left="11" right="12" top="12" bottom="11"/>
|
||||||
</BackgroundInsets>
|
</BackgroundInsets>
|
||||||
@@ -25,7 +25,6 @@
|
|||||||
<EdgeSize>
|
<EdgeSize>
|
||||||
<AbsValue val="32"/>
|
<AbsValue val="32"/>
|
||||||
</EdgeSize>
|
</EdgeSize>
|
||||||
<Color r="0" g="0" b="0" a="0.9"/>
|
|
||||||
</Backdrop>
|
</Backdrop>
|
||||||
|
|
||||||
<Layers>
|
<Layers>
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ end
|
|||||||
|
|
||||||
-- OnLoad
|
-- OnLoad
|
||||||
function Guda_SettingsPopup_OnLoad(self)
|
function Guda_SettingsPopup_OnLoad(self)
|
||||||
|
-- Set up initial backdrop
|
||||||
|
Guda:ApplyBackdrop(self, "DEFAULT_FRAME")
|
||||||
|
|
||||||
local title = getglobal(self:GetName().."_Title")
|
local title = getglobal(self:GetName().."_Title")
|
||||||
title:SetText("Guda Settings")
|
title:SetText("Guda Settings")
|
||||||
-- Increase title font size
|
-- Increase title font size
|
||||||
@@ -62,6 +65,7 @@ function Guda_SettingsPopup_OnShow(self)
|
|||||||
if hoverBagline == nil then
|
if hoverBagline == nil then
|
||||||
hoverBagline = false
|
hoverBagline = false
|
||||||
end
|
end
|
||||||
|
local bgTransparency = Guda.Modules.DB:GetSetting("bgTransparency") or 0.15
|
||||||
|
|
||||||
-- Update sliders and checkboxes
|
-- Update sliders and checkboxes
|
||||||
local bagSlider = getglobal("Guda_SettingsPopup_BagColumnsSlider")
|
local bagSlider = getglobal("Guda_SettingsPopup_BagColumnsSlider")
|
||||||
@@ -69,6 +73,7 @@ function Guda_SettingsPopup_OnShow(self)
|
|||||||
local iconSizeSlider = getglobal("Guda_SettingsPopup_IconSizeSlider")
|
local iconSizeSlider = getglobal("Guda_SettingsPopup_IconSizeSlider")
|
||||||
local iconFontSizeSlider = getglobal("Guda_SettingsPopup_IconFontSizeSlider")
|
local iconFontSizeSlider = getglobal("Guda_SettingsPopup_IconFontSizeSlider")
|
||||||
local iconSpacingSlider = getglobal("Guda_SettingsPopup_IconSpacingSlider")
|
local iconSpacingSlider = getglobal("Guda_SettingsPopup_IconSpacingSlider")
|
||||||
|
local bgTransparencySlider = getglobal("Guda_SettingsPopup_BgTransparencySlider")
|
||||||
local lockCheckbox = getglobal("Guda_SettingsPopup_LockBagsCheckbox")
|
local lockCheckbox = getglobal("Guda_SettingsPopup_LockBagsCheckbox")
|
||||||
local hideBordersCheckbox = getglobal("Guda_SettingsPopup_HideBordersCheckbox")
|
local hideBordersCheckbox = getglobal("Guda_SettingsPopup_HideBordersCheckbox")
|
||||||
local qualityBorderEquipmentCheckbox = getglobal("Guda_SettingsPopup_QualityBorderEquipmentCheckbox")
|
local qualityBorderEquipmentCheckbox = getglobal("Guda_SettingsPopup_QualityBorderEquipmentCheckbox")
|
||||||
@@ -97,6 +102,10 @@ function Guda_SettingsPopup_OnShow(self)
|
|||||||
iconSpacingSlider:SetValue(iconSpacing)
|
iconSpacingSlider:SetValue(iconSpacing)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if bgTransparencySlider then
|
||||||
|
bgTransparencySlider:SetValue(bgTransparency)
|
||||||
|
end
|
||||||
|
|
||||||
if lockCheckbox then
|
if lockCheckbox then
|
||||||
lockCheckbox:SetChecked(lockBags and 1 or 0)
|
lockCheckbox:SetChecked(lockBags and 1 or 0)
|
||||||
end
|
end
|
||||||
@@ -220,6 +229,60 @@ function Guda_SettingsPopup_BankColumnsSlider_OnValueChanged(self)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Background Transparency Slider OnLoad
|
||||||
|
function Guda_SettingsPopup_BgTransparencySlider_OnLoad(self)
|
||||||
|
getglobal(self:GetName().."Low"):SetText("0%")
|
||||||
|
getglobal(self:GetName().."High"):SetText("100%")
|
||||||
|
|
||||||
|
local text = getglobal(self:GetName().."Text")
|
||||||
|
text:SetText("Background Transparency")
|
||||||
|
|
||||||
|
-- Increase font size
|
||||||
|
local font, _, flags = text:GetFont()
|
||||||
|
if font then
|
||||||
|
text:SetFont(font, 12, flags)
|
||||||
|
end
|
||||||
|
|
||||||
|
self:SetMinMaxValues(0.0, 1.0)
|
||||||
|
self:SetValueStep(0.05)
|
||||||
|
|
||||||
|
local currentValue = Guda.Modules.DB:GetSetting("bgTransparency") or 0.15
|
||||||
|
self:SetValue(currentValue)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Background Transparency Slider OnValueChanged
|
||||||
|
function Guda_SettingsPopup_BgTransparencySlider_OnValueChanged(self)
|
||||||
|
local value = self:GetValue()
|
||||||
|
-- Round to 2 decimal places
|
||||||
|
value = math.floor(value * 100 + 0.5) / 100
|
||||||
|
|
||||||
|
-- Update display text
|
||||||
|
getglobal(self:GetName().."Text"):SetText("Background Transparency: " .. math.floor(value * 100) .. "%")
|
||||||
|
|
||||||
|
-- Save setting
|
||||||
|
Guda.Modules.DB:SetSetting("bgTransparency", value)
|
||||||
|
|
||||||
|
-- Apply transparency
|
||||||
|
Guda_ApplyBackgroundTransparency()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Apply background transparency to bag and bank frames
|
||||||
|
function Guda_ApplyBackgroundTransparency()
|
||||||
|
local transparency = Guda.Modules.DB:GetSetting("bgTransparency") or 0.15
|
||||||
|
local alpha = 1.0 - transparency
|
||||||
|
|
||||||
|
local frames = { "Guda_BagFrame", "Guda_BankFrame", "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
|
||||||
|
end
|
||||||
|
|
||||||
-- Icon Size Slider OnLoad
|
-- Icon Size Slider OnLoad
|
||||||
function Guda_SettingsPopup_IconSizeSlider_OnLoad(self)
|
function Guda_SettingsPopup_IconSizeSlider_OnLoad(self)
|
||||||
getglobal(self:GetName().."Low"):SetText("30px")
|
getglobal(self:GetName().."Low"):SetText("30px")
|
||||||
|
|||||||
+25
-4
@@ -3,7 +3,7 @@
|
|||||||
<!-- Settings Popup Frame -->
|
<!-- Settings Popup Frame -->
|
||||||
<Frame name="Guda_SettingsPopup" toplevel="true" movable="true" enableMouse="true" hidden="true" parent="UIParent" frameStrata="DIALOG">
|
<Frame name="Guda_SettingsPopup" toplevel="true" movable="true" enableMouse="true" hidden="true" parent="UIParent" frameStrata="DIALOG">
|
||||||
<Size>
|
<Size>
|
||||||
<AbsDimension x="420" y="530"/>
|
<AbsDimension x="420" y="570"/>
|
||||||
</Size>
|
</Size>
|
||||||
|
|
||||||
<Anchors>
|
<Anchors>
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
</Anchor>
|
</Anchor>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
|
|
||||||
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
|
<Backdrop bgFile="Interface\ChatFrame\ChatFrameBackground" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
|
||||||
<BackgroundInsets>
|
<BackgroundInsets>
|
||||||
<AbsInset left="11" right="12" top="12" bottom="11"/>
|
<AbsInset left="11" right="12" top="12" bottom="11"/>
|
||||||
</BackgroundInsets>
|
</BackgroundInsets>
|
||||||
@@ -24,7 +24,6 @@
|
|||||||
<EdgeSize>
|
<EdgeSize>
|
||||||
<AbsValue val="32"/>
|
<AbsValue val="32"/>
|
||||||
</EdgeSize>
|
</EdgeSize>
|
||||||
<Color r="0" g="0" b="0" a="0.9"/>
|
|
||||||
</Backdrop>
|
</Backdrop>
|
||||||
|
|
||||||
<Layers>
|
<Layers>
|
||||||
@@ -170,10 +169,32 @@
|
|||||||
</Scripts>
|
</Scripts>
|
||||||
</Slider>
|
</Slider>
|
||||||
|
|
||||||
|
<!-- Background Transparency Slider -->
|
||||||
|
<Slider name="$parent_BgTransparencySlider" inherits="OptionsSliderTemplate">
|
||||||
|
<Size>
|
||||||
|
<AbsDimension x="370" y="17"/>
|
||||||
|
</Size>
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parent_IconSpacingSlider">
|
||||||
|
<Offset>
|
||||||
|
<AbsDimension x="0" y="-40"/>
|
||||||
|
</Offset>
|
||||||
|
</Anchor>
|
||||||
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnLoad>
|
||||||
|
Guda_SettingsPopup_BgTransparencySlider_OnLoad(this)
|
||||||
|
</OnLoad>
|
||||||
|
<OnValueChanged>
|
||||||
|
Guda_SettingsPopup_BgTransparencySlider_OnValueChanged(this)
|
||||||
|
</OnValueChanged>
|
||||||
|
</Scripts>
|
||||||
|
</Slider>
|
||||||
|
|
||||||
<!-- Lock Bags Checkbox -->
|
<!-- Lock Bags Checkbox -->
|
||||||
<CheckButton name="$parent_LockBagsCheckbox" inherits="OptionsCheckButtonTemplate">
|
<CheckButton name="$parent_LockBagsCheckbox" inherits="OptionsCheckButtonTemplate">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parent_IconSpacingSlider">
|
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parent_BgTransparencySlider">
|
||||||
<Offset>
|
<Offset>
|
||||||
<AbsDimension x="-170" y="-30"/>
|
<AbsDimension x="-170" y="-30"/>
|
||||||
</Offset>
|
</Offset>
|
||||||
|
|||||||
Reference in New Issue
Block a user