fix: update settings and button ui
This commit is contained in:
+127
-74
@@ -61,15 +61,15 @@ function Guda_SettingsPopup_OnLoad(self)
|
||||
local generalTab = getglobal("Guda_SettingsPopup_GeneralTab")
|
||||
if generalTab then
|
||||
CreateSectionHeader(generalTab, "Appearance", -12)
|
||||
CreateSectionHeader(generalTab, "Options", -120)
|
||||
CreateSectionHeader(generalTab, "Automation", -230)
|
||||
CreateSectionHeader(generalTab, "Options", -140)
|
||||
CreateSectionHeader(generalTab, "Automation", -250)
|
||||
end
|
||||
|
||||
local layoutTab = getglobal("Guda_SettingsPopup_LayoutTab")
|
||||
if layoutTab then
|
||||
CreateSectionHeader(layoutTab, "View", -12)
|
||||
CreateSectionHeader(layoutTab, "Columns", -72)
|
||||
CreateSectionHeader(layoutTab, "Options", -190)
|
||||
CreateSectionHeader(layoutTab, "Columns", -100)
|
||||
CreateSectionHeader(layoutTab, "Options", -240)
|
||||
end
|
||||
|
||||
local iconsTab = getglobal("Guda_SettingsPopup_IconsTab")
|
||||
@@ -193,9 +193,9 @@ function Guda_SettingsPopup_OnShow(self)
|
||||
local showTooltipCountsCheckbox = getglobal("Guda_SettingsPopup_ShowTooltipCountsCheckbox")
|
||||
local showEquipSetCategoriesCheckbox = getglobal("Guda_SettingsPopup_ShowEquipSetCategoriesCheckbox")
|
||||
local markEquipmentSetsCheckbox = getglobal("Guda_SettingsPopup_MarkEquipmentSetsCheckbox")
|
||||
local bagViewButton = getglobal("Guda_SettingsPopup_BagViewTypeButton")
|
||||
local bankViewButton = getglobal("Guda_SettingsPopup_BankViewTypeButton")
|
||||
local themeButton = getglobal("Guda_SettingsPopup_ThemeButton")
|
||||
local bagViewDropdown = getglobal("Guda_SettingsPopup_BagViewDropdown")
|
||||
local bankViewDropdown = getglobal("Guda_SettingsPopup_BankViewDropdown")
|
||||
local themeDropdown = getglobal("Guda_SettingsPopup_ThemeDropdown")
|
||||
|
||||
local showTooltipCounts = Guda.Modules.DB:GetSetting("showTooltipCounts")
|
||||
if showTooltipCounts == nil then
|
||||
@@ -308,27 +308,23 @@ function Guda_SettingsPopup_OnShow(self)
|
||||
whiteItemsJunkCheckbox:SetChecked(whiteItemsJunk and 1 or 0)
|
||||
end
|
||||
|
||||
if bagViewButton then
|
||||
if bagViewType == "single" then
|
||||
bagViewButton:SetText("Bag View: Single")
|
||||
else
|
||||
bagViewButton:SetText("Bag View: Category")
|
||||
end
|
||||
if bagViewDropdown then
|
||||
UIDropDownMenu_SetSelectedValue(bagViewDropdown, bagViewType)
|
||||
UIDropDownMenu_SetText(bagViewType == "single" and "Single" or "Category", bagViewDropdown)
|
||||
end
|
||||
|
||||
if bankViewButton then
|
||||
if bankViewType == "single" then
|
||||
bankViewButton:SetText("Bank View: Single")
|
||||
else
|
||||
bankViewButton:SetText("Bank View: Category")
|
||||
end
|
||||
if bankViewDropdown then
|
||||
UIDropDownMenu_SetSelectedValue(bankViewDropdown, bankViewType)
|
||||
UIDropDownMenu_SetText(bankViewType == "single" and "Single" or "Category", bankViewDropdown)
|
||||
end
|
||||
|
||||
-- Initialize theme dropdown button text
|
||||
if themeButton then
|
||||
-- Initialize theme dropdown
|
||||
local themeDropdown = getglobal("Guda_SettingsPopup_ThemeDropdown")
|
||||
if themeDropdown then
|
||||
local currentTheme = Guda.Modules.DB:GetSetting("theme") or "guda"
|
||||
local names = { guda = "Guda", blizzard = "Blizzard" }
|
||||
themeButton:SetText(names[currentTheme] or currentTheme)
|
||||
UIDropDownMenu_SetSelectedValue(themeDropdown, currentTheme)
|
||||
UIDropDownMenu_SetText(names[currentTheme] or currentTheme, themeDropdown)
|
||||
end
|
||||
|
||||
-- Apply border visibility
|
||||
@@ -1444,13 +1440,41 @@ function Guda_SettingsPopup_WhiteItemsJunkCheckbox_OnClick(self)
|
||||
end
|
||||
end
|
||||
|
||||
-- Theme Dropdown OnClick
|
||||
function Guda_SettingsPopup_ThemeDropdown_OnClick(button)
|
||||
local themes = {
|
||||
{ text = "Guda", themeId = "guda" },
|
||||
{ text = "Blizzard", themeId = "blizzard" },
|
||||
}
|
||||
Guda_ShowSimpleDropdown(button, themes, "theme")
|
||||
-- Theme Dropdown (Blizzard UIDropDownMenu)
|
||||
local themeOptions = {
|
||||
{ text = "Guda", value = "guda" },
|
||||
{ text = "Blizzard", value = "blizzard" },
|
||||
}
|
||||
|
||||
local function Guda_ThemeDropdown_Initialize()
|
||||
local currentTheme = Guda.Modules.DB:GetSetting("theme") or "guda"
|
||||
for _, option in ipairs(themeOptions) do
|
||||
local info = {}
|
||||
info.text = option.text
|
||||
info.value = option.value
|
||||
info.func = function()
|
||||
local val = this.value
|
||||
UIDropDownMenu_SetSelectedValue(getglobal("Guda_SettingsPopup_ThemeDropdown"), val)
|
||||
Guda_SettingsPopup_ApplyTheme(val)
|
||||
end
|
||||
info.checked = (currentTheme == option.value)
|
||||
UIDropDownMenu_AddButton(info)
|
||||
end
|
||||
end
|
||||
|
||||
function Guda_SettingsPopup_ThemeDropdown_OnLoad(self)
|
||||
UIDropDownMenu_Initialize(self, Guda_ThemeDropdown_Initialize)
|
||||
UIDropDownMenu_SetWidth(130, self)
|
||||
local currentTheme = Guda.Modules.DB:GetSetting("theme") or "guda"
|
||||
local names = { guda = "Guda", blizzard = "Blizzard" }
|
||||
UIDropDownMenu_SetSelectedValue(self, currentTheme)
|
||||
UIDropDownMenu_SetText(names[currentTheme] or currentTheme, self)
|
||||
|
||||
-- Add label above dropdown
|
||||
local label = self:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
|
||||
label:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 20, 2)
|
||||
label:SetText("Theme")
|
||||
label:SetTextColor(1, 0.82, 0, 1)
|
||||
end
|
||||
|
||||
-- Apply selected theme
|
||||
@@ -1462,11 +1486,12 @@ function Guda_SettingsPopup_ApplyTheme(themeId)
|
||||
Guda.Modules.Theme:ClearCache()
|
||||
end
|
||||
|
||||
-- Update button text
|
||||
local btn = getglobal("Guda_SettingsPopup_ThemeButton")
|
||||
if btn then
|
||||
-- Update dropdown text
|
||||
local dropdown = getglobal("Guda_SettingsPopup_ThemeDropdown")
|
||||
if dropdown then
|
||||
local names = { guda = "Guda", blizzard = "Blizzard" }
|
||||
btn:SetText(names[themeId] or themeId)
|
||||
UIDropDownMenu_SetSelectedValue(dropdown, themeId)
|
||||
UIDropDownMenu_SetText(names[themeId] or themeId, dropdown)
|
||||
end
|
||||
|
||||
-- Apply theme to all frames (also updates slot background alphas)
|
||||
@@ -1475,54 +1500,82 @@ function Guda_SettingsPopup_ApplyTheme(themeId)
|
||||
end
|
||||
end
|
||||
|
||||
-- Bag View Type Button OnClick
|
||||
function Guda_SettingsPopup_BagViewTypeButton_OnClick()
|
||||
-- Bag View Dropdown
|
||||
local bagViewOptions = {
|
||||
{ text = "Category", value = "category" },
|
||||
{ text = "Single", value = "single" },
|
||||
}
|
||||
|
||||
local function Guda_BagViewDropdown_Initialize()
|
||||
local current = Guda.Modules.DB:GetSetting("bagViewType") or "single"
|
||||
local newValue = (current == "single") and "category" or "single"
|
||||
Guda.Modules.DB:SetSetting("bagViewType", newValue)
|
||||
|
||||
local btn = getglobal("Guda_SettingsPopup_BagViewTypeButton")
|
||||
if btn then
|
||||
btn:SetText(newValue == "single" and "Bag View: Single" or "Bag View: Category")
|
||||
end
|
||||
|
||||
-- Release all buttons so they can be reused when switching views
|
||||
if Guda_ReleaseAllButtons then
|
||||
Guda_ReleaseAllButtons()
|
||||
end
|
||||
|
||||
-- Refresh BOTH frames to ensure buttons are properly distributed
|
||||
if Guda_BagFrame:IsShown() then
|
||||
Guda.Modules.BagFrame:Update()
|
||||
end
|
||||
if Guda_BankFrame and Guda_BankFrame:IsShown() then
|
||||
Guda.Modules.BankFrame:Update()
|
||||
for _, option in ipairs(bagViewOptions) do
|
||||
local info = {}
|
||||
info.text = option.text
|
||||
info.value = option.value
|
||||
info.func = function()
|
||||
local val = this.value
|
||||
UIDropDownMenu_SetSelectedValue(getglobal("Guda_SettingsPopup_BagViewDropdown"), val)
|
||||
UIDropDownMenu_SetText(val == "single" and "Single" or "Category", getglobal("Guda_SettingsPopup_BagViewDropdown"))
|
||||
Guda.Modules.DB:SetSetting("bagViewType", val)
|
||||
if Guda_ReleaseAllButtons then Guda_ReleaseAllButtons() end
|
||||
if Guda_BagFrame:IsShown() then Guda.Modules.BagFrame:Update() end
|
||||
if Guda_BankFrame and Guda_BankFrame:IsShown() then Guda.Modules.BankFrame:Update() end
|
||||
end
|
||||
info.checked = (current == option.value)
|
||||
UIDropDownMenu_AddButton(info)
|
||||
end
|
||||
end
|
||||
|
||||
-- Bank View Type Button OnClick
|
||||
function Guda_SettingsPopup_BankViewTypeButton_OnClick()
|
||||
function Guda_SettingsPopup_BagViewDropdown_OnLoad(self)
|
||||
UIDropDownMenu_Initialize(self, Guda_BagViewDropdown_Initialize)
|
||||
UIDropDownMenu_SetWidth(130, self)
|
||||
local current = Guda.Modules.DB:GetSetting("bagViewType") or "single"
|
||||
UIDropDownMenu_SetSelectedValue(self, current)
|
||||
UIDropDownMenu_SetText(current == "single" and "Single" or "Category", self)
|
||||
|
||||
local label = self:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
|
||||
label:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 20, 2)
|
||||
label:SetText("Bag View")
|
||||
label:SetTextColor(1, 0.82, 0, 1)
|
||||
end
|
||||
|
||||
-- Bank View Dropdown
|
||||
local bankViewOptions = {
|
||||
{ text = "Category", value = "category" },
|
||||
{ text = "Single", value = "single" },
|
||||
}
|
||||
|
||||
local function Guda_BankViewDropdown_Initialize()
|
||||
local current = Guda.Modules.DB:GetSetting("bankViewType") or "single"
|
||||
local newValue = (current == "single") and "category" or "single"
|
||||
Guda.Modules.DB:SetSetting("bankViewType", newValue)
|
||||
for _, option in ipairs(bankViewOptions) do
|
||||
local info = {}
|
||||
info.text = option.text
|
||||
info.value = option.value
|
||||
info.func = function()
|
||||
local val = this.value
|
||||
UIDropDownMenu_SetSelectedValue(getglobal("Guda_SettingsPopup_BankViewDropdown"), val)
|
||||
UIDropDownMenu_SetText(val == "single" and "Single" or "Category", getglobal("Guda_SettingsPopup_BankViewDropdown"))
|
||||
Guda.Modules.DB:SetSetting("bankViewType", val)
|
||||
if Guda_ReleaseAllButtons then Guda_ReleaseAllButtons() end
|
||||
if Guda_BankFrame and Guda_BankFrame:IsShown() then Guda.Modules.BankFrame:Update() end
|
||||
if Guda_BagFrame:IsShown() then Guda.Modules.BagFrame:Update() end
|
||||
end
|
||||
info.checked = (current == option.value)
|
||||
UIDropDownMenu_AddButton(info)
|
||||
end
|
||||
end
|
||||
|
||||
local btn = getglobal("Guda_SettingsPopup_BankViewTypeButton")
|
||||
if btn then
|
||||
btn:SetText(newValue == "single" and "Bank View: Single" or "Bank View: Category")
|
||||
end
|
||||
function Guda_SettingsPopup_BankViewDropdown_OnLoad(self)
|
||||
UIDropDownMenu_Initialize(self, Guda_BankViewDropdown_Initialize)
|
||||
UIDropDownMenu_SetWidth(130, self)
|
||||
local current = Guda.Modules.DB:GetSetting("bankViewType") or "single"
|
||||
UIDropDownMenu_SetSelectedValue(self, current)
|
||||
UIDropDownMenu_SetText(current == "single" and "Single" or "Category", self)
|
||||
|
||||
-- Release all buttons so they can be reused when switching views
|
||||
if Guda_ReleaseAllButtons then
|
||||
Guda_ReleaseAllButtons()
|
||||
end
|
||||
|
||||
-- Refresh BOTH frames to ensure buttons are properly distributed
|
||||
if Guda_BankFrame and Guda_BankFrame:IsShown() then
|
||||
Guda.Modules.BankFrame:Update()
|
||||
end
|
||||
if Guda_BagFrame:IsShown() then
|
||||
Guda.Modules.BagFrame:Update()
|
||||
end
|
||||
local label = self:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
|
||||
label:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 20, 2)
|
||||
label:SetText("Bank View")
|
||||
label:SetTextColor(1, 0.82, 0, 1)
|
||||
end
|
||||
|
||||
-- Reverse Stack Sort Checkbox OnLoad
|
||||
|
||||
+24
-54
@@ -209,54 +209,26 @@
|
||||
</Anchors>
|
||||
<Frames>
|
||||
<!-- Appearance section -->
|
||||
<!-- Theme Label + Dropdown -->
|
||||
<Frame name="Guda_SettingsPopup_ThemeRow">
|
||||
<Size><AbsDimension x="300" y="25"/></Size>
|
||||
<!-- Theme Dropdown -->
|
||||
<Frame name="Guda_SettingsPopup_ThemeDropdown" inherits="UIDropDownMenuTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT">
|
||||
<Offset><AbsDimension x="5" y="-30"/></Offset>
|
||||
<Offset><AbsDimension x="-10" y="-45"/></Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Layers>
|
||||
<Layer level="ARTWORK">
|
||||
<FontString name="Guda_SettingsPopup_ThemeLabel" inherits="GameFontNormal">
|
||||
<Anchors>
|
||||
<Anchor point="LEFT">
|
||||
<Offset><AbsDimension x="0" y="0"/></Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</FontString>
|
||||
</Layer>
|
||||
</Layers>
|
||||
<Frames>
|
||||
<Button name="Guda_SettingsPopup_ThemeButton" inherits="UIPanelButtonTemplate">
|
||||
<Size><AbsDimension x="140" y="22"/></Size>
|
||||
<Anchors>
|
||||
<Anchor point="LEFT" relativeTo="Guda_SettingsPopup_ThemeLabel" relativePoint="RIGHT">
|
||||
<Offset><AbsDimension x="8" y="0"/></Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
local label = getglobal("Guda_SettingsPopup_ThemeLabel")
|
||||
if label then
|
||||
label:SetText("Theme:")
|
||||
local f, _, fl = label:GetFont()
|
||||
if f then label:SetFont(f, 12, fl) end
|
||||
end
|
||||
</OnLoad>
|
||||
<OnClick>Guda_SettingsPopup_ThemeDropdown_OnClick(this)</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
</Frames>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
Guda_SettingsPopup_ThemeDropdown_OnLoad(this)
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
|
||||
<!-- Background Transparency Slider -->
|
||||
<Slider name="Guda_SettingsPopup_BgTransparencySlider" inherits="OptionsSliderTemplate">
|
||||
<Size><AbsDimension x="450" y="17"/></Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="Guda_SettingsPopup_ThemeRow">
|
||||
<Offset><AbsDimension x="0" y="-25"/></Offset>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="Guda_SettingsPopup_ThemeDropdown">
|
||||
<Offset><AbsDimension x="15" y="-25"/></Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
@@ -349,39 +321,37 @@
|
||||
</Anchors>
|
||||
<Frames>
|
||||
<!-- View section -->
|
||||
<!-- Bag View Type Button -->
|
||||
<Button name="Guda_SettingsPopup_BagViewTypeButton" inherits="UIPanelButtonTemplate">
|
||||
<Size><AbsDimension x="180" y="25"/></Size>
|
||||
<!-- Bag View Type Dropdown -->
|
||||
<Frame name="Guda_SettingsPopup_BagViewDropdown" inherits="UIDropDownMenuTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT">
|
||||
<Offset><AbsDimension x="5" y="-30"/></Offset>
|
||||
<Offset><AbsDimension x="-10" y="-45"/></Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnClick>Guda_SettingsPopup_BagViewTypeButton_OnClick()</OnClick>
|
||||
<OnLoad>Guda_SettingsPopup_BagViewDropdown_OnLoad(this)</OnLoad>
|
||||
</Scripts>
|
||||
</Button>
|
||||
</Frame>
|
||||
|
||||
<!-- Bank View Type Button -->
|
||||
<Button name="Guda_SettingsPopup_BankViewTypeButton" inherits="UIPanelButtonTemplate">
|
||||
<Size><AbsDimension x="180" y="25"/></Size>
|
||||
<!-- Bank View Type Dropdown -->
|
||||
<Frame name="Guda_SettingsPopup_BankViewDropdown" inherits="UIDropDownMenuTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="LEFT" relativeTo="Guda_SettingsPopup_BagViewTypeButton" relativePoint="RIGHT">
|
||||
<Offset><AbsDimension x="55" y="0"/></Offset>
|
||||
<Anchor point="LEFT" relativeTo="Guda_SettingsPopup_BagViewDropdown" relativePoint="RIGHT">
|
||||
<Offset><AbsDimension x="30" y="0"/></Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnClick>Guda_SettingsPopup_BankViewTypeButton_OnClick()</OnClick>
|
||||
<OnLoad>Guda_SettingsPopup_BankViewDropdown_OnLoad(this)</OnLoad>
|
||||
</Scripts>
|
||||
</Button>
|
||||
</Frame>
|
||||
|
||||
<!-- Columns section -->
|
||||
<!-- Bag Columns Slider -->
|
||||
<Slider name="Guda_SettingsPopup_BagColumnsSlider" inherits="OptionsSliderTemplate">
|
||||
<Size><AbsDimension x="450" y="17"/></Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="Guda_SettingsPopup_BagViewTypeButton">
|
||||
<Offset><AbsDimension x="0" y="-45"/></Offset>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="Guda_SettingsPopup_BagViewDropdown">
|
||||
<Offset><AbsDimension x="15" y="-65"/></Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
@@ -409,7 +379,7 @@
|
||||
<CheckButton name="Guda_SettingsPopup_ShowSearchBarCheckbox" inherits="OptionsCheckButtonTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="Guda_SettingsPopup_BankColumnsSlider">
|
||||
<Offset><AbsDimension x="0" y="-45"/></Offset>
|
||||
<Offset><AbsDimension x="0" y="-55"/></Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
|
||||
Reference in New Issue
Block a user