Add confirmation dialog when ignoring breakables

This commit is contained in:
2023-08-02 17:54:32 -05:00
parent bc3632d177
commit 4c816fc5ed
2 changed files with 28 additions and 3 deletions

View File

@ -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

View File

@ -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