Skip to content

Commit 49532e7

Browse files
committed
Reset Page: switch to custom popup, extend coverage to Visibility/Group Labels/Pinned Frames
- Reset/Copy/Sync confirmation popups now use DF:ShowPopupAlert (the addon's built-in popup) instead of Blizzard's StaticPopup, matching the wizard/alert dialog style used elsewhere. - Add the Sync/Copy/Reset trio to three pages that were previously missing it: Visibility, Group Labels, and Pinned Frames. These all contain mode-specific settings and now match the rest of the addon. - Skip Class Colors and Aura Blacklist — those write to profile-level shared tables, not party/raid mode-specific tables.
1 parent e1ed63e commit 49532e7

2 files changed

Lines changed: 49 additions & 42 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
### New Features
66

77
* **Reset Page button** — every settings page that has a Sync/Copy button now also has a red **Reset Page** button to the left of them. Clicking it resets only that page's settings on the current mode (Party or Raid) back to their built-in defaults, with a confirmation popup. Aura Designer and Click Casting have their own reset systems and are not part of this.
8+
* **Sync / Copy / Reset trio added to Visibility, Group Labels, and Pinned Frames pages** — these pages were previously missing the Sync-with-Raid/Party and Copy-to-Raid/Party buttons; they now match the rest of the addon's settings pages.
89

910
### Improvements
1011

12+
* The Reset, Copy, and Sync confirmation popups now use the addon's built-in popup style instead of the default Blizzard popup, matching the rest of the wizard and alert dialogs.
1113
* (Aura Designer) Sound indicator: "Missing Trigger" can now be toggled off so only the Expire Alert fires. Expire Alert now has its own Loop Interval and a Play Once option. Start Delay and Loop Interval no longer affect the Expire Alert. (PR #54 by Krathe)
1214

1315
### Bug Fixes

Options/Options.lua

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,20 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage)
125125
btn:SetScript("OnClick", function()
126126
local mode = GUI.SelectedMode or "party"
127127
local dest = mode == "party" and L["Raid"] or L["Party"]
128-
-- Show confirmation
129-
StaticPopupDialogs["DANDERSFRAMES_COPY_SECTION"] = {
130-
text = format(L["Copy %s settings to %s?"], sectionName, dest),
131-
button1 = L["Copy"],
132-
button2 = L["Cancel"],
133-
OnAccept = function()
134-
DF:CopySectionSettings(prefixes, mode)
135-
if GUI.RefreshCurrentPage then GUI:RefreshCurrentPage() end
136-
end,
137-
timeout = 0,
138-
whileDead = true,
139-
hideOnEscape = true,
140-
}
141-
StaticPopup_Show("DANDERSFRAMES_COPY_SECTION")
128+
DF:ShowPopupAlert({
129+
title = format(L["Copy %s Settings"], sectionName),
130+
message = format(L["Copy %s settings to %s?"], sectionName, dest),
131+
buttons = {
132+
{
133+
label = L["Copy"],
134+
onClick = function()
135+
DF:CopySectionSettings(prefixes, mode)
136+
if GUI.RefreshCurrentPage then GUI:RefreshCurrentPage() end
137+
end,
138+
},
139+
{ label = L["Cancel"] },
140+
},
141+
})
142142
end)
143143

144144
-- Sync button event handlers
@@ -177,20 +177,21 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage)
177177
else
178178
local mode = GUI.SelectedMode or "party"
179179
local dest = mode == "party" and L["Raid"] or L["Party"]
180-
StaticPopupDialogs["DANDERSFRAMES_LINK_SECTION"] = {
181-
text = format(L["Sync %s settings?\n\nThis will copy current %s settings to %s and keep them in sync."], sectionName, sectionName, dest),
182-
button1 = L["Sync"],
183-
button2 = L["Cancel"],
184-
OnAccept = function()
185-
DF.db.linkedSections[pageId] = true
186-
DF:CopySectionSettings(prefixes, mode)
187-
if GUI.RefreshCurrentPage then GUI:RefreshCurrentPage() end
188-
end,
189-
timeout = 0,
190-
whileDead = true,
191-
hideOnEscape = true,
192-
}
193-
StaticPopup_Show("DANDERSFRAMES_LINK_SECTION")
180+
DF:ShowPopupAlert({
181+
title = format(L["Sync: %s"], sectionName),
182+
message = format(L["Sync %s settings?\n\nThis will copy current %s settings to %s and keep them in sync."], sectionName, sectionName, dest),
183+
buttons = {
184+
{
185+
label = L["Sync"],
186+
onClick = function()
187+
DF.db.linkedSections[pageId] = true
188+
DF:CopySectionSettings(prefixes, mode)
189+
if GUI.RefreshCurrentPage then GUI:RefreshCurrentPage() end
190+
end,
191+
},
192+
{ label = L["Cancel"] },
193+
},
194+
})
194195
end
195196
end)
196197
end
@@ -251,19 +252,20 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage)
251252
resetBtn:SetScript("OnClick", function()
252253
local mode = GUI.SelectedMode or "party"
253254
local m = (mode == "party") and L["Party"] or L["Raid"]
254-
StaticPopupDialogs["DANDERSFRAMES_RESET_SECTION"] = {
255-
text = format(L["Reset %s settings to defaults?\n\nThis only affects %s settings on the current %s mode. This cannot be undone."], sectionName, sectionName, m),
256-
button1 = L["Reset"],
257-
button2 = L["Cancel"],
258-
OnAccept = function()
259-
DF:ResetSectionSettings(prefixes, mode)
260-
if GUI.RefreshCurrentPage then GUI:RefreshCurrentPage() end
261-
end,
262-
timeout = 0,
263-
whileDead = true,
264-
hideOnEscape = true,
265-
}
266-
StaticPopup_Show("DANDERSFRAMES_RESET_SECTION")
255+
DF:ShowPopupAlert({
256+
title = format(L["Reset: %s"], sectionName),
257+
message = format(L["Reset %s settings to defaults?\n\nThis only affects %s settings on the current %s mode. This cannot be undone."], sectionName, sectionName, m),
258+
buttons = {
259+
{
260+
label = L["Reset"],
261+
onClick = function()
262+
DF:ResetSectionSettings(prefixes, mode)
263+
if GUI.RefreshCurrentPage then GUI:RefreshCurrentPage() end
264+
end,
265+
},
266+
{ label = L["Cancel"] },
267+
},
268+
})
267269
end)
268270

269271
-- Initial update
@@ -295,7 +297,8 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage)
295297
-- Display > Visibility
296298
local pageVisibility = CreateSubTab("display", "display_visibility", L["Visibility"])
297299
BuildPage(pageVisibility, function(self, db, Add, AddSpace, AddSyncPoint)
298-
300+
Add(CreateCopyButton(self.child, {"soloMode", "hidePlayerFrame", "hideDefaultPlayerFrame", "showMinimapButton", "restedIndicator"}, L["Visibility"], "display_visibility"), 25, 2)
301+
299302
-- ===== FRAME DISPLAY GROUP (Column 1) =====
300303
local frameDisplayGroup = GUI:CreateSettingsGroup(self.child, 280)
301304
frameDisplayGroup:AddWidget(GUI:CreateHeader(self.child, L["Frame Display"]), 40)
@@ -1835,6 +1838,7 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage)
18351838
-- General > Group Labels (Raid only, group-based layout only)
18361839
local pageGroupLabels = CreateSubTab("general", "general_labels", L["Group Labels"])
18371840
BuildPage(pageGroupLabels, function(self, db, Add, AddSpace, AddSyncPoint)
1841+
Add(CreateCopyButton(self.child, {"groupLabel"}, L["Group Labels"], "general_labels"), 25, 2)
18381842
local function HideGroupLabelOptions(d)
18391843
return GUI.SelectedMode ~= "raid" or not d.raidUseGroups or not d.groupLabelEnabled
18401844
end
@@ -1911,6 +1915,7 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage)
19111915
-- General > Pinned Frames
19121916
local pagePinnedFrames = CreateSubTab("general", "general_pinnedframes", L["Pinned Frames"])
19131917
BuildPage(pagePinnedFrames, function(self, db, Add, AddSpace, AddSyncPoint)
1918+
Add(CreateCopyButton(self.child, {"pinnedFrames"}, L["Pinned Frames"], "general_pinnedframes"), 25, 2)
19141919
-- Constants
19151920
local HIGHLIGHT_MAX_SETS = 2
19161921

0 commit comments

Comments
 (0)