Skip to content

Commit

Permalink
Add confirmation dialog when ignoring breakables
Browse files Browse the repository at this point in the history
  • Loading branch information
parnic committed Aug 2, 2023
1 parent bc3632d commit 4c816fc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
27 changes: 24 additions & 3 deletions Breakables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 4c816fc

Please sign in to comment.