Skip to content

Commit dcefef2

Browse files
committed
Reset Page: extend coverage to Integrations, Global Fonts, Aura Blacklist
- Integrations and Global Fonts pages get the full Sync/Copy/Reset trio. Both write to mode-specific settings (color picker / Masque / click- through toggles, and font shadow X/Y/colour respectively) so the trio applies cleanly. - New CreateResetOnlyButton helper (also exposed as GUI.CreateResetOnly Button) for pages that aren't mode-specific and shouldn't have Sync/Copy. Renders the same red Reset Page button + confirmation popup, but takes a custom onReset callback so the page chooses what 'reset' means. - Aura Blacklist gets a Reset-only button (top right) that clears all custom blacklist toggles. Notice banner is squeezed to make room. Skips the trio because the blacklist is profile-level, shared across modes. - Skipped General Settings: its controls span 5 different storage locations (profile, mode-specific, per-character, GlobalDB) so a one- click reset is too ambiguous to be a clear win.
1 parent 49532e7 commit dcefef2

4 files changed

Lines changed: 104 additions & 2 deletions

File tree

AuraBlacklist/Options.lua

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,24 @@ function DF.BuildAuraBlacklistPage(guiRef, pageRef, dbRef)
374374
return container
375375
end
376376

377+
-- ========== RESET PAGE BUTTON (top right) ==========
378+
if GUI.CreateResetOnlyButton then
379+
local resetBtn = GUI.CreateResetOnlyButton(parent, L["Aura Blacklist"], function()
380+
if DF.db then
381+
DF.db.auraBlacklist = { buffs = {}, debuffs = {} }
382+
if pageRef._buffWidget and pageRef._buffWidget.Refresh then pageRef._buffWidget:Refresh() end
383+
if pageRef._debuffWidget and pageRef._debuffWidget.Refresh then pageRef._debuffWidget:Refresh() end
384+
if DF.RefreshAllVisibleFrames then DF:RefreshAllVisibleFrames() end
385+
print("|cff00ff00DandersFrames:|r " .. L["Aura Blacklist reset to defaults."])
386+
end
387+
end, L["This will clear all of your custom blacklist toggles."])
388+
resetBtn:SetPoint("TOPRIGHT", -10, -10)
389+
end
390+
377391
-- ========== CURATED LIST NOTICE ==========
378392
local noticeBanner = CreateFrame("Frame", nil, parent, "BackdropTemplate")
379393
noticeBanner:SetPoint("TOPLEFT", 10, -10)
380-
noticeBanner:SetPoint("RIGHT", -10, 0)
394+
noticeBanner:SetPoint("RIGHT", -135, 0)
381395
noticeBanner:SetHeight(44)
382396
if not noticeBanner.SetBackdrop then Mixin(noticeBanner, BackdropTemplateMixin) end
383397
noticeBanner:SetBackdrop({ bgFile = "Interface\\Buttons\\WHITE8x8", edgeFile = "Interface\\Buttons\\WHITE8x8", edgeSize = 1 })

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
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.
8+
* **Sync / Copy / Reset trio added to Visibility, Group Labels, Pinned Frames, Integrations, and Global Fonts 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.
9+
* **Reset Page button added to the Aura Blacklist page** — clicking it clears all of your custom blacklist toggles, with a confirmation popup. Sync/Copy doesn't apply here since the blacklist is shared across both modes.
910

1011
### Improvements
1112

Locales/enUS.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ L["Attached + Overflow"] = true
315315
L["Attached to Health"] = true
316316
L["Attached to Owner"] = true
317317
L["Aura Blacklist"] = true
318+
L["Aura Blacklist reset to defaults."] = true
318319
L["Aura Data Source"] = true
319320
L["Aura Designer"] = true
320321
L["Aura Designer Alpha"] = true
@@ -1115,6 +1116,9 @@ L["Replace Blizzard's color picker with the DandersFrames color picker for this
11151116
L["Recommended"] = true
11161117
L["Reset %d %s settings to defaults."] = true
11171118
L["Reset %s settings on %s mode to defaults. Other settings are not affected."] = true
1119+
L["Reset %s settings to defaults. This cannot be undone."] = true
1120+
L["Reset %s settings to defaults?\n\n%s\n\nThis cannot be undone."] = true
1121+
L["Reset %s settings to defaults?\n\nThis cannot be undone."] = true
11181122
L["Reset %s settings to defaults?\n\nThis only affects %s settings on the current %s mode. This cannot be undone."] = true
11191123
L["Reset: %s"] = true
11201124
L["Reset All to Default"] = true
@@ -1330,6 +1334,7 @@ L["Thick Outline"] = true
13301334
L["Thickness"] = true
13311335
L["This setting differs from the global profile value. Click the reset button to revert."] = true
13321336
L["This setting is being overridden by the active auto layout profile. To change it, edit the profile in the Auto Layouts tab."] = true
1337+
L["This will clear all of your custom blacklist toggles."] = true
13331338
L["This is a curated list selected by Blizzard. Additional spells cannot be added as these are the only spells Blizzard has allowed. If more are permitted in the future, they will be added to this list."] = true
13341339
L["This overlay is rendered by Blizzard and has limited customisation. It is separate from the DandersFrames overlay above."] = true
13351340
L["Threat Colors"] = true

Options/Options.lua

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,86 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage)
281281
-- Expose for use by sub-pages (e.g. Aura Designer)
282282
GUI.CreateCopyButton = CreateCopyButton
283283

284+
-- Standalone Reset button for pages whose settings aren't mode-specific
285+
-- and so don't get the full Sync/Copy trio. Uses the same red palette and
286+
-- confirmation popup style as the trio's Reset button.
287+
--
288+
-- parent: widget parent (typically self.child inside BuildPage)
289+
-- sectionName: localised page name, used in the popup and tooltip
290+
-- onReset: callback that performs the actual reset; the helper
291+
-- handles the confirmation popup before invoking this
292+
-- warningText: optional extra line below the standard message (string)
293+
local function CreateResetOnlyButton(parent, sectionName, onReset, warningText)
294+
local resetBtn = CreateFrame("Button", nil, parent, "BackdropTemplate")
295+
resetBtn:SetSize(115, 26)
296+
resetBtn.rightAlign = true
297+
298+
if not resetBtn.SetBackdrop then Mixin(resetBtn, BackdropTemplateMixin) end
299+
resetBtn:SetBackdrop({
300+
bgFile = "Interface\\Buttons\\WHITE8x8",
301+
edgeFile = "Interface\\Buttons\\WHITE8x8",
302+
edgeSize = 1,
303+
})
304+
resetBtn:SetBackdropColor(0.18, 0.18, 0.18, 1)
305+
resetBtn:SetBackdropBorderColor(0.6, 0.25, 0.25, 0.6)
306+
307+
resetBtn.Icon = resetBtn:CreateTexture(nil, "OVERLAY")
308+
resetBtn.Icon:SetPoint("LEFT", 8, 0)
309+
resetBtn.Icon:SetSize(14, 14)
310+
resetBtn.Icon:SetTexture("Interface\\AddOns\\DandersFrames\\Media\\Icons\\refresh")
311+
resetBtn.Icon:SetVertexColor(0.7, 0.4, 0.4)
312+
313+
resetBtn.Text = resetBtn:CreateFontString(nil, "OVERLAY", "DFFontHighlightSmall")
314+
resetBtn.Text:SetPoint("LEFT", resetBtn.Icon, "RIGHT", 4, 0)
315+
resetBtn.Text:SetText(L["Reset Page"])
316+
resetBtn.Text:SetTextColor(0.7, 0.4, 0.4)
317+
318+
resetBtn:SetScript("OnEnter", function(self)
319+
self:SetBackdropColor(0.4, 0.15, 0.15, 1)
320+
self:SetBackdropBorderColor(1, 0.4, 0.4, 1)
321+
self.Text:SetTextColor(1, 0.7, 0.7)
322+
self.Icon:SetVertexColor(1, 0.7, 0.7)
323+
324+
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
325+
GameTooltip:SetText(format(L["Reset: %s"], sectionName))
326+
GameTooltip:AddLine(format(L["Reset %s settings to defaults. This cannot be undone."], sectionName), 1, 1, 1, true)
327+
GameTooltip:Show()
328+
end)
329+
330+
resetBtn:SetScript("OnLeave", function(self)
331+
self:SetBackdropColor(0.18, 0.18, 0.18, 1)
332+
self:SetBackdropBorderColor(0.6, 0.25, 0.25, 0.6)
333+
self.Text:SetTextColor(0.7, 0.4, 0.4)
334+
self.Icon:SetVertexColor(0.7, 0.4, 0.4)
335+
GameTooltip:Hide()
336+
end)
337+
338+
resetBtn:SetScript("OnClick", function()
339+
local message = format(L["Reset %s settings to defaults?\n\nThis cannot be undone."], sectionName)
340+
if warningText and warningText ~= "" then
341+
message = format(L["Reset %s settings to defaults?\n\n%s\n\nThis cannot be undone."], sectionName, warningText)
342+
end
343+
DF:ShowPopupAlert({
344+
title = format(L["Reset: %s"], sectionName),
345+
message = message,
346+
buttons = {
347+
{
348+
label = L["Reset"],
349+
onClick = function()
350+
if onReset then onReset() end
351+
if GUI.RefreshCurrentPage then GUI:RefreshCurrentPage() end
352+
end,
353+
},
354+
{ label = L["Cancel"] },
355+
},
356+
})
357+
end)
358+
359+
return resetBtn
360+
end
361+
362+
GUI.CreateResetOnlyButton = CreateResetOnlyButton
363+
284364
-- Define category order (updated structure)
285365
GUI.CategoryOrder = {"general", "clickcast", "display", "bars", "text", "auras", "indicators", "profiles", "debug"}
286366

@@ -1683,6 +1763,7 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage)
16831763
-- General > Global Fonts
16841764
local pageGlobalFonts = CreateSubTab("general", "general_fonts", L["Global Fonts"])
16851765
BuildPage(pageGlobalFonts, function(self, db, Add, AddSpace, AddSyncPoint)
1766+
Add(CreateCopyButton(self.child, {"fontShadow"}, L["Global Fonts"], "general_fonts"), 25, 2)
16861767
-- Initialize temp storage for selections (persists during session)
16871768
if not DF.GlobalFontTemp then
16881769
DF.GlobalFontTemp = {
@@ -3070,6 +3151,7 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage)
30703151
-- General > Integrations
30713152
local pageIntegrations = CreateSubTab("general", "general_integrations", L["Integrations"])
30723153
BuildPage(pageIntegrations, function(self, db, Add, AddSpace, AddSyncPoint)
3154+
Add(CreateCopyButton(self.child, {"colorPicker", "masque", "buffDisableMouse", "debuffDisableMouse", "defensiveIconDisableMouse", "targetedSpellDisableMouse"}, L["Integrations"], "general_integrations"), 25, 2)
30733155
-- ===== COLOR PICKER GROUP (Column 1) =====
30743156
local colorPickerGroup = GUI:CreateSettingsGroup(self.child, 280)
30753157
colorPickerGroup:AddWidget(GUI:CreateHeader(self.child, L["Color Picker"]), 40)

0 commit comments

Comments
 (0)