feat: hide footer option
This commit is contained in:
+4
-1
@@ -42,13 +42,16 @@ function DB:Initialize()
|
||||
showQualityBorderEquipment = true,
|
||||
showQualityBorderOther = true,
|
||||
showSearchBar = true,
|
||||
showQuestBar = true,
|
||||
hoverBagline = false,
|
||||
hideFooter = false,
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
-- Ensure new settings exist for existing installations
|
||||
if Guda_CharDB.settings.hideFooter == nil then
|
||||
Guda_CharDB.settings.hideFooter = false
|
||||
end
|
||||
if Guda_CharDB.settings.hoverBagline == nil then
|
||||
Guda_CharDB.settings.hoverBagline = false
|
||||
end
|
||||
|
||||
+45
-2
@@ -91,6 +91,11 @@ function Guda_BagFrame_OnShow(self)
|
||||
BagFrame:UpdateSearchBarVisibility()
|
||||
end
|
||||
|
||||
-- Apply footer visibility setting
|
||||
if BagFrame.UpdateFooterVisibility then
|
||||
BagFrame:UpdateFooterVisibility()
|
||||
end
|
||||
|
||||
BagFrame:Update()
|
||||
end
|
||||
|
||||
@@ -152,10 +157,17 @@ end
|
||||
|
||||
-- Update bagline layout (hover option)
|
||||
function BagFrame:UpdateBaglineLayout()
|
||||
local hoverBagline = addon.Modules.DB:GetSetting("hoverBagline")
|
||||
local hideFooter = addon.Modules.DB:GetSetting("hideFooter")
|
||||
local toolbar = getglobal("Guda_BagFrame_Toolbar")
|
||||
if not toolbar then return end
|
||||
|
||||
if hideFooter then
|
||||
toolbar:Hide()
|
||||
return
|
||||
end
|
||||
|
||||
local hoverBagline = addon.Modules.DB:GetSetting("hoverBagline")
|
||||
|
||||
local bag0 = getglobal("Guda_BagFrame_Toolbar_BagSlot0")
|
||||
local bag1 = getglobal("Guda_BagFrame_Toolbar_BagSlot1")
|
||||
local bag2 = getglobal("Guda_BagFrame_Toolbar_BagSlot2")
|
||||
@@ -528,7 +540,13 @@ function BagFrame:ResizeFrame(currentRow, currentCol, columns)
|
||||
local searchBarHeight = 30
|
||||
local footerHeight
|
||||
local frameHeight
|
||||
if showSearchBar then
|
||||
|
||||
local hideFooter = addon.Modules.DB:GetSetting("hideFooter")
|
||||
|
||||
if hideFooter then
|
||||
footerHeight = 10 -- Small padding at bottom
|
||||
frameHeight = containerHeight + titleHeight + (showSearchBar and searchBarHeight or 0) + footerHeight
|
||||
elseif showSearchBar then
|
||||
footerHeight = 55 -- Increased footer height when search bar is visible (toolbar 40px + spacing 15px)
|
||||
frameHeight = containerHeight + titleHeight + searchBarHeight + footerHeight -- 125 total
|
||||
else
|
||||
@@ -681,8 +699,14 @@ function BagFrame:PassesSearchFilter(itemData)
|
||||
end
|
||||
|
||||
function BagFrame:UpdateMoney()
|
||||
local hideFooter = addon.Modules.DB:GetSetting("hideFooter")
|
||||
local moneyFrame = getglobal("Guda_BagFrame_MoneyFrame")
|
||||
|
||||
if hideFooter then
|
||||
if moneyFrame then moneyFrame:Hide() end
|
||||
return
|
||||
end
|
||||
|
||||
if not moneyFrame then
|
||||
addon:Debug("Guda_BagFrame exists: " .. tostring(getglobal("Guda_BagFrame") ~= nil))
|
||||
|
||||
@@ -1676,6 +1700,25 @@ function BagFrame:UpdateSearchBarVisibility()
|
||||
end
|
||||
end
|
||||
|
||||
-- Update footer visibility based on settings
|
||||
function BagFrame:UpdateFooterVisibility()
|
||||
local hideFooter = addon.Modules.DB:GetSetting("hideFooter")
|
||||
local toolbar = getglobal("Guda_BagFrame_Toolbar")
|
||||
local moneyFrame = getglobal("Guda_BagFrame_MoneyFrame")
|
||||
|
||||
if hideFooter then
|
||||
if toolbar then toolbar:Hide() end
|
||||
if moneyFrame then moneyFrame:Hide() end
|
||||
else
|
||||
if toolbar then toolbar:Show() end
|
||||
if moneyFrame then moneyFrame:Show() end
|
||||
|
||||
-- Trigger layout updates to ensure they are correctly positioned
|
||||
self:UpdateBaglineLayout()
|
||||
self:UpdateMoney()
|
||||
end
|
||||
end
|
||||
|
||||
-- Bag Slot Button Handlers
|
||||
|
||||
-- OnLoad handler for bag slot buttons
|
||||
|
||||
+42
-7
@@ -57,13 +57,18 @@ function Guda_BankFrame_OnShow(self)
|
||||
BankFrame:UpdateBorderVisibility()
|
||||
end
|
||||
|
||||
-- Apply search bar visibility setting
|
||||
if BankFrame.UpdateSearchBarVisibility then
|
||||
BankFrame:UpdateSearchBarVisibility()
|
||||
end
|
||||
-- Apply search bar visibility setting
|
||||
if BankFrame.UpdateSearchBarVisibility then
|
||||
BankFrame:UpdateSearchBarVisibility()
|
||||
end
|
||||
|
||||
BankFrame:Update()
|
||||
end
|
||||
-- Apply footer visibility setting
|
||||
if BankFrame.UpdateFooterVisibility then
|
||||
BankFrame:UpdateFooterVisibility()
|
||||
end
|
||||
|
||||
BankFrame:Update()
|
||||
end
|
||||
|
||||
-- Toggle visibility
|
||||
function BankFrame:Toggle()
|
||||
@@ -360,7 +365,13 @@ function BankFrame:ResizeFrame(currentRow, currentCol, columns)
|
||||
local searchBarHeight = 30
|
||||
local footerHeight = 40
|
||||
local frameHeight
|
||||
if showSearchBar then
|
||||
|
||||
local hideFooter = addon.Modules.DB:GetSetting("hideFooter")
|
||||
|
||||
if hideFooter then
|
||||
footerHeight = 10 -- Small padding at bottom
|
||||
frameHeight = containerHeight + titleHeight + (showSearchBar and searchBarHeight or 0) + footerHeight
|
||||
elseif showSearchBar then
|
||||
frameHeight = containerHeight + titleHeight + searchBarHeight + footerHeight -- 125 total
|
||||
else
|
||||
frameHeight = containerHeight + titleHeight + footerHeight -- 80 total
|
||||
@@ -451,8 +462,14 @@ end
|
||||
|
||||
-- Update money display
|
||||
function BankFrame:UpdateMoney()
|
||||
local hideFooter = addon.Modules.DB:GetSetting("hideFooter")
|
||||
local moneyFrame = getglobal("Guda_BankFrame_MoneyFrame")
|
||||
|
||||
if hideFooter then
|
||||
if moneyFrame then moneyFrame:Hide() end
|
||||
return
|
||||
end
|
||||
|
||||
if not moneyFrame then
|
||||
addon:Debug("Bank MoneyFrame not found! Checking parent...")
|
||||
addon:Debug("Guda_BankFrame exists: " .. tostring(getglobal("Guda_BankFrame") ~= nil))
|
||||
@@ -945,6 +962,24 @@ function BankFrame:UpdateSearchBarVisibility()
|
||||
end
|
||||
end
|
||||
|
||||
-- Update footer visibility based on settings
|
||||
function BankFrame:UpdateFooterVisibility()
|
||||
local hideFooter = addon.Modules.DB:GetSetting("hideFooter")
|
||||
local toolbar = getglobal("Guda_BankFrame_Toolbar")
|
||||
local moneyFrame = getglobal("Guda_BankFrame_MoneyFrame")
|
||||
|
||||
if hideFooter then
|
||||
if toolbar then toolbar:Hide() end
|
||||
if moneyFrame then moneyFrame:Hide() end
|
||||
else
|
||||
if toolbar then toolbar:Show() end
|
||||
if moneyFrame then moneyFrame:Show() end
|
||||
|
||||
-- Trigger layout updates to ensure they are correctly positioned
|
||||
self:UpdateMoney()
|
||||
end
|
||||
end
|
||||
|
||||
-- Initialize
|
||||
function BankFrame:Initialize()
|
||||
-- Hide Blizzard bank frame on load (pfUI style)
|
||||
|
||||
@@ -339,6 +339,9 @@ function Guda_SettingsPopup_IconSpacingSlider_OnValueChanged(self)
|
||||
-- Update bank frame
|
||||
local bankFrame = getglobal("Guda_BankFrame")
|
||||
if bankFrame and bankFrame:IsShown() then
|
||||
if Guda.Modules.BankFrame.UpdateFooterVisibility then
|
||||
Guda.Modules.BankFrame:UpdateFooterVisibility()
|
||||
end
|
||||
Guda.Modules.BankFrame:Update()
|
||||
end
|
||||
end
|
||||
@@ -658,6 +661,58 @@ function Guda_SettingsPopup_HoverBaglineCheckbox_OnClick(self)
|
||||
end
|
||||
end
|
||||
|
||||
-- Hide Footer Checkbox OnLoad
|
||||
function Guda_SettingsPopup_HideFooterCheckbox_OnLoad(self)
|
||||
local text = getglobal(self:GetName().."Text")
|
||||
if text then
|
||||
text:SetText("Hide Footer")
|
||||
|
||||
-- Increase font size
|
||||
local font, _, flags = text:GetFont()
|
||||
if font then
|
||||
text:SetFont(font, 13, flags)
|
||||
end
|
||||
end
|
||||
|
||||
local hideFooter = false
|
||||
if Guda and Guda.Modules and Guda.Modules.DB then
|
||||
hideFooter = Guda.Modules.DB:GetSetting("hideFooter")
|
||||
if hideFooter == nil then
|
||||
hideFooter = false
|
||||
end
|
||||
end
|
||||
|
||||
self:SetChecked(hideFooter and 1 or 0)
|
||||
end
|
||||
|
||||
-- Hide Footer Checkbox OnClick
|
||||
function Guda_SettingsPopup_HideFooterCheckbox_OnClick(self)
|
||||
local isChecked = self:GetChecked() == 1
|
||||
|
||||
-- Save setting
|
||||
if Guda and Guda.Modules and Guda.Modules.DB then
|
||||
Guda.Modules.DB:SetSetting("hideFooter", isChecked)
|
||||
end
|
||||
|
||||
-- Update bag frame
|
||||
local bagFrame = getglobal("Guda_BagFrame")
|
||||
if bagFrame and bagFrame:IsShown() then
|
||||
if Guda.Modules.BagFrame.UpdateFooterVisibility then
|
||||
Guda.Modules.BagFrame:UpdateFooterVisibility()
|
||||
end
|
||||
Guda.Modules.BagFrame:Update()
|
||||
end
|
||||
|
||||
-- Update bank frame
|
||||
local bankFrame = getglobal("Guda_BankFrame")
|
||||
if bankFrame and bankFrame:IsShown() then
|
||||
if Guda.Modules.BankFrame.UpdateFooterVisibility then
|
||||
Guda.Modules.BankFrame:UpdateFooterVisibility()
|
||||
end
|
||||
Guda.Modules.BankFrame:Update()
|
||||
end
|
||||
end
|
||||
|
||||
-- Initialize
|
||||
function SettingsPopup:Initialize()
|
||||
Guda:Debug("Settings popup initialized")
|
||||
|
||||
@@ -302,6 +302,25 @@
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</CheckButton>
|
||||
|
||||
<!-- Hide Footer Checkbox -->
|
||||
<CheckButton name="$parent_HideFooterCheckbox" inherits="OptionsCheckButtonTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_HoverBaglineCheckbox">
|
||||
<Offset>
|
||||
<AbsDimension x="150" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
Guda_SettingsPopup_HideFooterCheckbox_OnLoad(this)
|
||||
</OnLoad>
|
||||
<OnClick>
|
||||
Guda_SettingsPopup_HideFooterCheckbox_OnClick(this)
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</CheckButton>
|
||||
</Frames>
|
||||
|
||||
<Scripts>
|
||||
|
||||
Reference in New Issue
Block a user