feat: offline mailbox
This commit is contained in:
+21
-1
@@ -17,8 +17,13 @@ local mailboxClickCatcher = nil
|
||||
|
||||
-- OnLoad
|
||||
function Guda_MailboxFrame_OnLoad(self)
|
||||
-- Apply border visibility setting
|
||||
if MailboxFrame.UpdateBorderVisibility then
|
||||
MailboxFrame:UpdateBorderVisibility()
|
||||
end
|
||||
|
||||
-- Set up initial backdrop
|
||||
addon:ApplyBackdrop(self, "DEFAULT_FRAME")
|
||||
-- (No longer needed here as UpdateBorderVisibility handles it)
|
||||
|
||||
-- Set up search box placeholder
|
||||
local searchBox = getglobal(self:GetName().."_SearchBar_SearchBox")
|
||||
@@ -53,6 +58,11 @@ end
|
||||
|
||||
-- OnShow
|
||||
function Guda_MailboxFrame_OnShow(self)
|
||||
-- Apply border visibility setting
|
||||
if MailboxFrame.UpdateBorderVisibility then
|
||||
MailboxFrame:UpdateBorderVisibility()
|
||||
end
|
||||
|
||||
-- Apply frame transparency
|
||||
if Guda_ApplyBackgroundTransparency then
|
||||
Guda_ApplyBackgroundTransparency()
|
||||
@@ -61,6 +71,16 @@ function Guda_MailboxFrame_OnShow(self)
|
||||
MailboxFrame:Update()
|
||||
end
|
||||
|
||||
-- Update border visibility
|
||||
function MailboxFrame:UpdateBorderVisibility()
|
||||
local hideBorders = addon.Modules.DB:GetSetting("hideBorders")
|
||||
if hideBorders then
|
||||
Guda:ApplyBackdrop(Guda_MailboxFrame, "MINIMALIST_BORDER", "DEFAULT")
|
||||
else
|
||||
Guda:ApplyBackdrop(Guda_MailboxFrame, "DEFAULT_FRAME", "DEFAULT")
|
||||
end
|
||||
end
|
||||
|
||||
-- OnHide
|
||||
function Guda_MailboxFrame_OnHide(self)
|
||||
-- Close any open dropdown menus when the mailbox frame is hidden
|
||||
|
||||
+10
-11
@@ -136,26 +136,31 @@
|
||||
</Button>
|
||||
|
||||
<!-- Search Bar -->
|
||||
<Frame name="$parent_SearchBar" inherits="OptionFrameBoxTemplate">
|
||||
<Frame name="$parent_SearchBar">
|
||||
<Size>
|
||||
<AbsDimension x="250" y="32"/>
|
||||
<AbsDimension x="350" y="30"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT">
|
||||
<Offset>
|
||||
<AbsDimension x="20" y="-35"/>
|
||||
<AbsDimension x="20" y="-40"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Frames>
|
||||
<EditBox name="$parent_SearchBox" autoFocus="false" inherits="InputBoxTemplate">
|
||||
<Size>
|
||||
<AbsDimension x="235" y="20"/>
|
||||
<AbsDimension x="0" y="20"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="LEFT">
|
||||
<Offset>
|
||||
<AbsDimension x="10" y="0"/>
|
||||
<AbsDimension x="16" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
<Anchor point="RIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="-10" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
@@ -190,12 +195,6 @@
|
||||
</Scripts>
|
||||
</EditBox>
|
||||
</Frames>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
this:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
||||
this:SetBackdropColor(0.15, 0.15, 0.15, 0.5)
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
|
||||
<!-- Character Selection Button -->
|
||||
|
||||
+10
-1
@@ -368,7 +368,7 @@ 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" }
|
||||
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
|
||||
@@ -603,6 +603,15 @@ function Guda_SettingsPopup_HideBordersCheckbox_OnClick(self)
|
||||
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")
|
||||
end
|
||||
end
|
||||
|
||||
-- Update border visibility on settings frame
|
||||
if SettingsPopup.UpdateBorderVisibility then
|
||||
SettingsPopup:UpdateBorderVisibility()
|
||||
|
||||
Reference in New Issue
Block a user