@@ -247,10 +247,16 @@ function DialogKey:GetValidPopupButtons()
247247end
248248
249249-- Takes a global string like '%s has challenged you to a duel.' and converts it to a format suitable for string.find
250- local summon_match = CONFIRM_SUMMON :gsub (" %%d" , " .+" ):format (" .+" , " .+" , " .+" )
251- local duel_match = DUEL_REQUESTED :format (" .+" )
252- local resurrect_match = RESURRECT_REQUEST_NO_SICKNESS :format (" .+" )
253- local groupinvite_match = INVITATION :format (" .+" )
250+ local summonMatch = CONFIRM_SUMMON :gsub (" %%d" , " .+" ):format (" .+" , " .+" , " .+" )
251+ local duelMatch = DUEL_REQUESTED :format (" .+" )
252+ local resurrectMatch = RESURRECT_REQUEST_NO_SICKNESS :format (" .+" )
253+ local groupinviteMatch = INVITATION :format (" .+" )
254+ local instanceLogMatches = {
255+ INSTANCE_LOCK_TIMER :format (" .+" , " .+" ),
256+ INSTANCE_LOCK_TIMER_PREVIOUSLY_SAVED :format (" .+" , " .+" ),
257+ INSTANCE_LOCK_WARNING :format (" .+" ),
258+ INSTANCE_LOCK_WARNING_PREVIOUSLY_SAVED :format (" .+" ),
259+ }
254260
255261--- @param popupFrame StaticPopupTemplate # One of the StaticPopup1-4 frames
256262--- @return Frame | nil | false # The button to click, nil if no button should be clicked, false if the text is empty and should be checked again later
@@ -262,11 +268,16 @@ function DialogKey:GetPopupButton(popupFrame)
262268 if not text or text == " " or text == " " then return false end
263269
264270 -- Don't accept group invitations if the option is enabled
265- if self .db .dontAcceptInvite and text :find (groupinvite_match ) then return end
271+ if self .db .dontAcceptInvite and text :find (groupinviteMatch ) then return end
266272
267273 -- Don't accept summons/duels/resurrects if the options are enabled
268- if self .db .dontClickSummons and text :find (summon_match ) then return end
269- if self .db .dontClickDuels and text :find (duel_match ) then return end
274+ if self .db .dontClickSummons and text :find (summonMatch ) then return end
275+ if self .db .dontClickDuels and text :find (duelMatch ) then return end
276+ if self .db .dontAcceptInstanceLocks then
277+ for _ , match in pairs (instanceLogMatches ) do
278+ if text :find (match ) then return end
279+ end
280+ end
270281
271282 -- If resurrect dialog has three buttons, and the option is enabled, use the middle one instead of the first one (soulstone, etc.)
272283 -- Located before resurrect/release checks/returns so it happens even if you have releases/revives disabled
@@ -279,7 +290,7 @@ function DialogKey:GetPopupButton(popupFrame)
279290 return popupFrame .button2
280291 end
281292
282- if self .db .dontClickRevives and (text == RECOVER_CORPSE or text :find (resurrect_match )) then return end
293+ if self .db .dontClickRevives and (text == RECOVER_CORPSE or text :find (resurrectMatch )) then return end
283294 if self .db .dontClickReleases and canRelease then return end
284295
285296 -- Ignore blacklisted popup dialogs!
0 commit comments