From 4c816fc5edc60a031c40be0020e08adc1e3d281a Mon Sep 17 00:00:00 2001 From: Parnic Date: Wed, 2 Aug 2023 17:54:32 -0500 Subject: [PATCH] Add confirmation dialog when ignoring breakables --- Breakables.lua | 27 ++++++++++++++++++++++++--- changelog.txt | 4 ++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/Breakables.lua b/Breakables.lua index 72bdfec..11f58e8 100644 --- a/Breakables.lua +++ b/Breakables.lua @@ -1120,11 +1120,32 @@ function Breakables:OnMouseUp(frame) self.settings.buttonFrameTop[frameNum] = frame:GetTop() end -local function IgnoreFunc(self, button, isDown) - if button == "RightButton" and isDown and not InCombatLockdown() then - Breakables.settings.ignoreList[self.itemId] = true +StaticPopupDialogs["BREAKABLES_CONFIRM_IGNORE"] = { + text = L["This will add the chosen item to the ignore list so it no longer appears as breakable. Items can be removed from the ignore list in the Breakables settings.\n\nWould you like to ignore this item?"], + button1 = YES, + OnShow = function(self) + self:SetFrameStrata("TOOLTIP") + end, + OnHide = function(self) + self:SetFrameStrata("DIALOG") + end, + OnAccept = function(self, data) + Breakables.settings.ignoreList[data] = true Breakables:FindBreakables() LibStub("AceConfigRegistry-3.0"):NotifyChange("Breakables") + end, + button2 = NO, + timeout = 0, + whileDead = 1, + hideOnEscape = 0 +} + +local function IgnoreFunc(self, button, isDown) + if button == "RightButton" and isDown and not InCombatLockdown() then + local dlg = StaticPopup_Show("BREAKABLES_CONFIRM_IGNORE") + if dlg then + dlg.data = self.itemId + end end end diff --git a/changelog.txt b/changelog.txt index ff74b3a..d3b549a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +v1.9.18: + +- Added a confirmation dialog when ignoring breakables, and updated the description to mention the ignore feature. + v1.9.17: - Update Dragonflight TOC for 10.1.5