Quantcast

Adding ability to remove the requirement to type the word "delete" when deleting good items

KyrosKrane [05-18-18 - 17:16]
Adding ability to remove the requirement to type the word "delete" when deleting good items
Filename
AnnoyingPopupRemover.lua
AnnoyingPopupRemover.toc
diff --git a/AnnoyingPopupRemover.lua b/AnnoyingPopupRemover.lua
index 88b5390..0cadf31 100644
--- a/AnnoyingPopupRemover.lua
+++ b/AnnoyingPopupRemover.lua
@@ -12,6 +12,7 @@
 --	It removes the popup confirmation dialog when rolling on a bind-on-pickup item.
 --	It removes the popup confirmation dialog when adding a BOP item to void storage, and that item is modified (gemmed, enchanted, or transmogged) or still tradable with the looting group.
 --	It removes the popup confirmation dialog when selling a BOP item to a vendor that was looted while grouped, and can still be traded to other group members.
+--	It changes the popup confirmation dialog when deleting a "good" item from requiring you to type the word "delete" to just yes/no.


 --#########################################
@@ -42,19 +43,19 @@
 --#########################################

 -- Define a global for our namespace
-local APR = { };
+local APR = { }

 -- Define whether we're in debug mode or production mode. True means debug; false means production.
-APR.DebugMode = false;
+APR.DebugMode = false

 -- Set the current version so we can display it.
-APR.Version = "@project-version@";
+APR.Version = "@project-version@"

 -- Create the frame to hold our event catcher, and the list of events.
-APR.Frame, APR.Events = CreateFrame("Frame"), {};
+APR.Frame, APR.Events = CreateFrame("Frame"), {}

 -- Create a holder to store dialogs we're removing, in case the user wants to restore them.
-APR.StoredDialogs = {};
+APR.StoredDialogs = {}

 -- Get a local reference to these functions to speed up execution.
 local rawset = rawset
@@ -64,7 +65,7 @@ local pairs = pairs
 local type = type

 -- Get the language used by the client.
-APR.locale = GetLocale();
+APR.locale = GetLocale()


 --#########################################
@@ -73,9 +74,9 @@ APR.locale = GetLocale();

 -- This bit of meta-magic makes it so that if we call L with a key that doesn't yet exist, a key is created automatically, and its value is the name of the key.  For example, if L["MyAddon"] doesn't exist, and I run print (L["MyAddon"]), the __index command causes the L table to automatically create a new key called MyAddon, and its value is set to tostring("MyAddon") -- same as the key name.
 local L = setmetatable({ }, {__index = function(t, k)
-	local v = tostring(k);
-	rawset(t, k, v);
-	return v;
+	local v = tostring(k)
+	rawset(t, k, v)
+	return v
 end})

 -- The above system effectively makes it so that we don't have to define the default, English-language values.  Just set the key name as the English value.
@@ -96,14 +97,14 @@ end})
 -- Print debug output to the chat frame.
 function APR:DebugPrint(...)
 	if (APR.DebugMode) then
-		print ("|cff" .. "a00000" .. L["APR"] .. " " .. L["Debug"] .. ":|r", ...);
+		print ("|cff" .. "a00000" .. L["APR"] .. " " .. L["Debug"] .. ":|r", ...)
 	end
 end -- APR:DebugPrint


 -- Print standard output to the chat frame.
 function APR:ChatPrint(...)
-	print ("|cff" .. "0066ff" .. L["APR"] ..":|r", ...);
+	print ("|cff" .. "0066ff" .. L["APR"] ..":|r", ...)
 end -- APR:ChatPrint()


@@ -114,7 +115,7 @@ function APR:PrintVarArgs(...)
 	local msg
 	for i = 1, n do
 		msg = select(i, ...)
-		APR:DebugPrint ("Item ", i, " is ", msg);
+		APR:DebugPrint ("Item ", i, " is ", msg)
 	end
 end -- APR:PrintVarArgs()

@@ -130,18 +131,18 @@ function APR:DumpTable(tab, indent)
 		local s = ""
 		if indent > 0 then
 			for i = 0, indent do
-				s = s .. "    ";
+				s = s .. "    "
 			end
 		end
 		if "table" == type(v) then
-			s = s .. "Item " .. k .. " is sub-table." ;
-			APR:DebugPrint(s);
-			indent = indent + 1;
-			APR:DumpTable(v, indent);
-			indent = indent - 1;
+			s = s .. "Item " .. k .. " is sub-table."
+			APR:DebugPrint(s)
+			indent = indent + 1
+			APR:DumpTable(v, indent)
+			indent = indent - 1
 		else
-			s = s .. "Item " .. k .. " is " .. tostring(v);
-			APR:DebugPrint(s);
+			s = s .. "Item " .. k .. " is " .. tostring(v)
+			APR:DebugPrint(s)
 		end
 	end
 end -- APR:DumpTable()
@@ -182,13 +183,13 @@ end -- APR:strsplit()
 --#########################################

 -- These are NOT settings; don't change these!
-local FORCE_HIDE_DIALOG = true;
-local PRINT_CONFIRMATION = true;
-local NO_CONFIRMATION = false;
-local HIDE_DIALOG = true;
-local SHOW_DIALOG = false;
-local PRINT_STARTUP = true;
-local HIDE_STARTUP = false;
+local FORCE_HIDE_DIALOG = true
+local PRINT_CONFIRMATION = true
+local NO_CONFIRMATION = false
+local HIDE_DIALOG = true
+local SHOW_DIALOG = false
+local PRINT_STARTUP = true
+local HIDE_STARTUP = false


 --#########################################
@@ -204,59 +205,59 @@ SlashCmdList.APR = function (...) APR:HandleCommandLine(...) end
 function APR:HandleCommandLine(msg, editbox)
 	-- no clue why the slash command handler passes in info about the message box itself, but it does...

-	APR:DebugPrint ("msg is " .. msg);
-	local Line = APR:strsplit("%s+", string.lower(msg));
-	-- APR:DumpTable(Line);
+	APR:DebugPrint ("msg is " .. msg)
+	local Line = APR:strsplit("%s+", string.lower(msg))
+	-- APR:DumpTable(Line)

 	-- Validate parameters. Only 1 and 2 are checked; rest are ignored.
 	if Line[2] then
 		-- Check for toggling a pop-up off or on
-		if "bind" == Line[2] or "loot" == Line[2] or "roll" == Line[2] or "void" == Line[2] or "vendor" == Line[2] then
+		if "bind" == Line[2] or "loot" == Line[2] or "roll" == Line[2] or "void" == Line[2] or "vendor" == Line[2] or "destroy" == Line[2] or "delete" == Line[2] then
 			if "show" == Line[1] or "hide" == Line[1] then
 				APR:TogglePopup(Line[2], Line[1])
-				return;
+				return
 			end
 		-- Check whether to announce ourself at startup
 		elseif "startup" == Line[2] then
 			if "show" == Line[1] or "hide" == Line[1] then
 				APR:ToggleStartupMessage(Line[1])
-				return;
+				return
 			end
 		-- Undocumented command to toggle the debug state from the command line.
 		elseif "debug" == Line[1] then
 			if "on" == Line[2] then
-				APR:SetDebug(true);
-				return;
+				APR:SetDebug(true)
+				return
 			elseif "off" == Line[2] then
-				APR:SetDebug(false);
-				return;
+				APR:SetDebug(false)
+				return
 			end
 		end
 	elseif Line[1] then
 		if "status" == Line[1] then
-			APR:PrintStatus();
-			return;
+			APR:PrintStatus()
+			return
 		elseif "help" == Line[1] then
-			APR:PrintHelp();
-			return;
+			APR:PrintHelp()
+			return
 		end

 	-- else no parameters specified
 	end

 	-- if we get here, then the validation failed.
-	APR:ChatPrint(L["Error: unknown command."]);
-	APR:PrintHelp();
+	APR:ChatPrint(L["Error: unknown command."])
+	APR:PrintHelp()
 end -- APR:HandleCommandLine()


 -- Print the instructions for the user.
 function APR:PrintHelp()
-	APR:ChatPrint (L["Allowed commands for"] .. " " .. L["Annoying Pop-up Remover"] .. ":");
-	APR:ChatPrint("/apr   show |cffFFCC00OR|r hide   loot |cffFFCC00OR|r roll |cffFFCC00OR|r void |cffFFCC00OR|r vendor"); -- not localized on purpose
-	APR:ChatPrint("/apr   show |cffFFCC00OR|r hide   startup"); -- not localized on purpose
-	APR:ChatPrint("/apr status"); -- not localized on purpose
-	APR:ChatPrint("/apr help"); -- not localized on purpose
+	APR:ChatPrint(L["Allowed commands for"] .. " " .. L["Annoying Pop-up Remover"] .. ":")
+	APR:ChatPrint("/apr   show |cffFFCC00OR|r hide   loot |cffFFCC00OR|r roll |cffFFCC00OR|r void |cffFFCC00OR|r vendor |cffFFCC00OR|r delete") -- not localized on purpose
+	APR:ChatPrint("/apr   show |cffFFCC00OR|r hide   startup") -- not localized on purpose
+	APR:ChatPrint("/apr status") -- not localized on purpose
+	APR:ChatPrint("/apr help") -- not localized on purpose
 end -- APR:PrintHelp()


@@ -265,30 +266,37 @@ end -- APR:PrintHelp()
 function APR:PrintStatus(popup)
 	if not popup or "loot" == popup then
 		if APR.DB.HideBind then
-			APR:ChatPrint (L["Confirmation pop-up when |cff00ff00looting|r bind-on-pickup items will be |cff00ff00hidden|r."]);
+			APR:ChatPrint (L["Confirmation pop-up when |cff00ff00looting|r bind-on-pickup items will be |cff00ff00hidden|r."])
 		else
-			APR:ChatPrint (L["Confirmation pop-up when |cffff0000looting|r bind-on-pickup items will be |cffff0000shown|r."]);
+			APR:ChatPrint (L["Confirmation pop-up when |cffff0000looting|r bind-on-pickup items will be |cffff0000shown|r."])
 		end
 	end
 	if not popup or "roll" == popup then
 		if APR.DB.HideRoll then
-			APR:ChatPrint (L["Confirmation pop-up when |cff00ff00rolling|r on bind-on-pickup items will be |cff00ff00hidden|r."]);
+			APR:ChatPrint (L["Confirmation pop-up when |cff00ff00rolling|r on bind-on-pickup items will be |cff00ff00hidden|r."])
 		else
-			APR:ChatPrint (L["Confirmation pop-up when |cffff0000rolling|r on bind-on-pickup items will be |cffff0000shown|r."]);
+			APR:ChatPrint (L["Confirmation pop-up when |cffff0000rolling|r on bind-on-pickup items will be |cffff0000shown|r."])
 		end
 	end
 	if not popup or "void" == popup then
 		if APR.DB.HideVoid then
-			APR:ChatPrint (L["Confirmation pop-up when depositing modified items into |cff00ff00void storage|r will be |cff00ff00hidden|r."]);
+			APR:ChatPrint (L["Confirmation pop-up when depositing modified items into |cff00ff00void storage|r will be |cff00ff00hidden|r."])
 		else
-			APR:ChatPrint (L["Confirmation pop-up when depositing modified items into |cffff0000void storage|r will be |cffff0000shown|r."]);
+			APR:ChatPrint (L["Confirmation pop-up when depositing modified items into |cffff0000void storage|r will be |cffff0000shown|r."])
 		end
 	end
 	if not popup or "vendor" == popup then
 		if APR.DB.HideVendor then
-			APR:ChatPrint (L["Confirmation pop-up when selling group-looted items to a |cff00ff00vendor|r will be |cff00ff00hidden|r."]);
+			APR:ChatPrint (L["Confirmation pop-up when selling group-looted items to a |cff00ff00vendor|r will be |cff00ff00hidden|r."])
 		else
-			APR:ChatPrint (L["Confirmation pop-up when selling group-looted items to a |cff00ff00vendor|r will be |cffff0000shown|r."]);
+			APR:ChatPrint (L["Confirmation pop-up when selling group-looted items to a |cff00ff00vendor|r will be |cffff0000shown|r."])
+		end
+	end
+	if not popup or "delete" == popup then
+		if APR.DB.HideDelete then
+			APR:ChatPrint (L["|cff00ff00Deleting \"good\" items|r will |cff00ff00not require|r typing the word \"delete\"."])
+		else
+			APR:ChatPrint (L["|cff00ff00Deleting \"good\" items|r will |cff00ff00require|r typing the word \"delete\"."])
 		end
 	end
 end -- APR:PrintStatus()
@@ -298,91 +306,115 @@ end -- APR:PrintStatus()
 -- popup is required, state is optional
 function APR:TogglePopup(popup, state)
 	-- Older versions of the addon used the keyword "bind" instead of "loot". Handle the case where a user tries to use the old keyword.
-	if "bind" == popup then popup = "loot" end;
+	if "bind" == popup then popup = "loot" end
+
+	-- The words "delete" and "destroy are synonymous for our purposes. The in-game dialog says "delete", but players refer to it as destroying an item.
+	-- We'll follow the game protocol of using the word "delete", but accept destroy as well.
+	if "destroy" == popup then popup = "delete" end

 	if "loot" == popup then
 		if state then
 			if "show" == state then
-				APR:ShowPopupBind(PRINT_CONFIRMATION);
+				APR:ShowPopupBind(PRINT_CONFIRMATION)
 			elseif "hide" == state then
-				APR:HidePopupBind(PRINT_CONFIRMATION);
+				APR:HidePopupBind(PRINT_CONFIRMATION)
 			else
 				-- error, bad programmer, no cookie!
-				APR:DebugPrint("Error in APR:TogglePopup: unknown state " .. state .. " for popup type " .. popup .. " passed in.");
+				APR:DebugPrint("Error in APR:TogglePopup: unknown state " .. state .. " for popup type " .. popup .. " passed in.")
 				return false
 			end
 		else
 			-- no state specified, so reverse the state. If Hide was on, then show it, and vice versa.
 			if APR.DB.HideBind then
-				APR:ShowPopupBind(PRINT_CONFIRMATION);
+				APR:ShowPopupBind(PRINT_CONFIRMATION)
 			else
-				APR:HidePopupBind(PRINT_CONFIRMATION);
+				APR:HidePopupBind(PRINT_CONFIRMATION)
 			end
 		end

 	elseif "roll" == popup then
 		if state then
 			if "show" == state then
-				APR:ShowPopupRoll(PRINT_CONFIRMATION);
+				APR:ShowPopupRoll(PRINT_CONFIRMATION)
 			elseif "hide" == state then
-				APR:HidePopupRoll(PRINT_CONFIRMATION);
+				APR:HidePopupRoll(PRINT_CONFIRMATION)
 			else
 				-- error, bad programmer, no cookie!
-				APR:DebugPrint("Error in APR:TogglePopup: unknown state " .. state .. " for popup type " .. popup .. " passed in.");
+				APR:DebugPrint("Error in APR:TogglePopup: unknown state " .. state .. " for popup type " .. popup .. " passed in.")
 				return false
 			end
 		else
 			-- no state specified, so reverse the state. If Hide was on, then show it, and vice versa.
 			if APR.DB.HideRoll then
-				APR:ShowPopupRoll(PRINT_CONFIRMATION);
+				APR:ShowPopupRoll(PRINT_CONFIRMATION)
 			else
-				APR:HidePopupRoll(PRINT_CONFIRMATION);
+				APR:HidePopupRoll(PRINT_CONFIRMATION)
 			end
 		end

 	elseif "void" == popup then
 		if state then
 			if "show" == state then
-				APR:ShowPopupVoid(PRINT_CONFIRMATION);
+				APR:ShowPopupVoid(PRINT_CONFIRMATION)
 			elseif "hide" == state then
-				APR:HidePopupVoid(PRINT_CONFIRMATION);
+				APR:HidePopupVoid(PRINT_CONFIRMATION)
 			else
 				-- error, bad programmer, no cookie!
-				APR:DebugPrint("Error in APR:TogglePopup: unknown state " .. state .. " for popup type " .. popup .. " passed in.");
+				APR:DebugPrint("Error in APR:TogglePopup: unknown state " .. state .. " for popup type " .. popup .. " passed in.")
 				return false
 			end
 		else
 			-- no state specified, so reverse the state. If Hide was on, then show it, and vice versa.
 			if APR.DB.HideVoid then
-				APR:ShowPopupVoid(PRINT_CONFIRMATION);
+				APR:ShowPopupVoid(PRINT_CONFIRMATION)
 			else
-				APR:HidePopupVoid(PRINT_CONFIRMATION);
+				APR:HidePopupVoid(PRINT_CONFIRMATION)
 			end
 		end

 	elseif "vendor" == popup then
 		if state then
 			if "show" == state then
-				APR:ShowPopupVendor(PRINT_CONFIRMATION);
+				APR:ShowPopupVendor(PRINT_CONFIRMATION)
 			elseif "hide" == state then
-				APR:HidePopupVendor(PRINT_CONFIRMATION);
+				APR:HidePopupVendor(PRINT_CONFIRMATION)
 			else
 				-- error, bad programmer, no cookie!
-				APR:DebugPrint("Error in APR:TogglePopup: unknown state " .. state .. " for popup type " .. popup .. " passed in.");
+				APR:DebugPrint("Error in APR:TogglePopup: unknown state " .. state .. " for popup type " .. popup .. " passed in.")
 				return false
 			end
 		else
 			-- no state specified, so reverse the state. If Hide was on, then show it, and vice versa.
 			if APR.DB.HideVendor then
-				APR:ShowPopupVendor(PRINT_CONFIRMATION);
+				APR:ShowPopupVendor(PRINT_CONFIRMATION)
 			else
-				APR:HidePopupVendor(PRINT_CONFIRMATION);
+				APR:HidePopupVendor(PRINT_CONFIRMATION)
+			end
+		end
+
+	elseif "delete" == popup then
+		if state then
+			if "show" == state then
+				APR:ShowPopupDelete(PRINT_CONFIRMATION)
+			elseif "hide" == state then
+				APR:HidePopupDelete(PRINT_CONFIRMATION)
+			else
+				-- error, bad programmer, no cookie!
+				APR:DebugPrint("Error in APR:TogglePopup: unknown state " .. state .. " for popup type " .. popup .. " passed in.")
+				return false
+			end
+		else
+			-- no state specified, so reverse the state. If Hide was on, then show it, and vice versa.
+			if APR.DB.HideDelete then
+				APR:ShowPopupDelete(PRINT_CONFIRMATION)
+			else
+				APR:HidePopupDelete(PRINT_CONFIRMATION)
 			end
 		end

 	else
 		-- error, bad programmer, no cookie!
-		APR:DebugPrint("Error in APR:TogglePopup: unknown popup type " .. popup .. " passed in.");
+		APR:DebugPrint("Error in APR:TogglePopup: unknown popup type " .. popup .. " passed in.")
 		return false
 	end
 end -- APR:TogglePopup()
@@ -390,10 +422,10 @@ end -- APR:TogglePopup()

 function APR:SetDebug(mode)
 	if mode then
-		APR.DebugMode = true;
+		APR.DebugMode = true
 		APR:ChatPrint (L["Debug mode is now on."])
 	else
-		APR.DebugMode = false;
+		APR.DebugMode = false
 		APR:ChatPrint (L["Debug mode is now off."])
 	end
 end -- APR:SetDebug()
@@ -401,14 +433,14 @@ end -- APR:SetDebug()

 function APR:ToggleStartupMessage(mode)
 	if "show" == mode then
-		APR.DB.PrintStartupMessage = PRINT_STARTUP;
+		APR.DB.PrintStartupMessage = PRINT_STARTUP
 		APR:ChatPrint (L["Startup announcement message will printed in your chat frame at login."])
 	elseif "hide" == mode then
-		APR.DB.PrintStartupMessage = HIDE_STARTUP;
+		APR.DB.PrintStartupMessage = HIDE_STARTUP
 		APR:ChatPrint (L["Startup announcement message will NOT printed in your chat frame at login."])
 	else
 		-- error, bad programmer, no cookie!
-		APR:DebugPrint("Error in APR:ToggleStartupMessage: unknown mode " .. mode .. " passed in.");
+		APR:DebugPrint("Error in APR:ToggleStartupMessage: unknown mode " .. mode .. " passed in.")
 		return false
 	end
 end -- APR:ToggleStartupMessage()
@@ -422,138 +454,172 @@ end -- APR:ToggleStartupMessage()
 -- not documenting individually, as it should be clear what they do.

 function APR:ShowPopupBind(printconfirm)
-	APR:DebugPrint ("in APR:ShowPopupBind");
+	APR:DebugPrint ("in APR:ShowPopupBind")
 	if APR.DB.HideBind then
 		-- Re-enable the dialog that pops to confirm looting BoP gear yourself.
-		StaticPopupDialogs["LOOT_BIND"] = APR.StoredDialogs["LOOT_BIND"];
-		APR.StoredDialogs["LOOT_BIND"] = nil;
+		StaticPopupDialogs["LOOT_BIND"] = APR.StoredDialogs["LOOT_BIND"]
+		APR.StoredDialogs["LOOT_BIND"] = nil

 		-- Mark that the dialog is shown.
-		APR.DB.HideBind = SHOW_DIALOG;
+		APR.DB.HideBind = SHOW_DIALOG

 	-- else already shown, nothing to do.
 	end

-	if printconfirm then APR:PrintStatus("loot") end;
+	if printconfirm then APR:PrintStatus("loot") end
 end -- APR:ShowPopupBind()


 function APR:ShowPopupRoll(printconfirm)
-	APR:DebugPrint ("in APR:ShowPopupRoll");
+	APR:DebugPrint ("in APR:ShowPopupRoll")
 	if APR.DB.HideRoll then
 		-- Re-enable the dialog for the event that triggers when rolling on BOP items.
-		StaticPopupDialogs["CONFIRM_LOOT_ROLL"] = APR.StoredDialogs["CONFIRM_LOOT_ROLL"];
-		APR.StoredDialogs["CONFIRM_LOOT_ROLL"] = nil;
+		StaticPopupDialogs["CONFIRM_LOOT_ROLL"] = APR.StoredDialogs["CONFIRM_LOOT_ROLL"]
+		APR.StoredDialogs["CONFIRM_LOOT_ROLL"] = nil

 		-- Mark that the dialog is shown.
-		APR.DB.HideRoll = SHOW_DIALOG;
+		APR.DB.HideRoll = SHOW_DIALOG

 	-- else already shown, nothing to do.
 	end

-	if printconfirm then APR:PrintStatus("roll") end;
+	if printconfirm then APR:PrintStatus("roll") end
 end -- APR:ShowPopupRoll()


 function APR:ShowPopupVoid(printconfirm)
-	APR:DebugPrint ("in APR:ShowPopupVoid");
+	APR:DebugPrint ("in APR:ShowPopupVoid")
 	if APR.DB.HideVoid then
 		-- Re-enable the dialog for putting tradable or modified items into void storage.
-		StaticPopupDialogs["VOID_DEPOSIT_CONFIRM"] = APR.StoredDialogs["VOID_DEPOSIT_CONFIRM"];
-		APR.StoredDialogs["VOID_DEPOSIT_CONFIRM"] = nil;
+		StaticPopupDialogs["VOID_DEPOSIT_CONFIRM"] = APR.StoredDialogs["VOID_DEPOSIT_CONFIRM"]
+		APR.StoredDialogs["VOID_DEPOSIT_CONFIRM"] = nil

 		-- Mark that the dialog is shown.
-		APR.DB.HideVoid = SHOW_DIALOG;
+		APR.DB.HideVoid = SHOW_DIALOG

 	-- else already shown, nothing to do.
 	end

-	if printconfirm then APR:PrintStatus("void") end;
+	if printconfirm then APR:PrintStatus("void") end
 end -- APR:ShowPopupVoid()


 function APR:ShowPopupVendor(printconfirm)
-	APR:DebugPrint ("in APR:ShowPopupVendor");
+	APR:DebugPrint ("in APR:ShowPopupVendor")
 	if APR.DB.HideVendor then
 		-- Re-enable the dialog for selling group-looted items to a vendor while still tradable.
-		StaticPopupDialogs["CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL"] = APR.StoredDialogs["CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL"];
-		APR.StoredDialogs["CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL"] = nil;
+		StaticPopupDialogs["CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL"] = APR.StoredDialogs["CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL"]
+		APR.StoredDialogs["CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL"] = nil
+
+		-- Mark that the dialog is shown.
+		APR.DB.HideVendor = SHOW_DIALOG
+
+	-- else already shown, nothing to do.
+	end
+
+	if printconfirm then APR:PrintStatus("vendor") end
+end -- APR:ShowPopupVendor()
+
+
+function APR:ShowPopupDelete(printconfirm)
+	APR:DebugPrint ("in APR:ShowPopupDelete")
+	if APR.DB.HideDelete then
+		-- Re-enable typing the word "delete" when deleting good items.
+		StaticPopupDialogs["DELETE_GOOD_ITEM"] = APR.StoredDialogs["DELETE_GOOD_ITEM"]
+		APR.StoredDialogs["DELETE_GOOD_ITEM"] = nil

 		-- Mark that the dialog is shown.
-		APR.DB.HideVendor = SHOW_DIALOG;
+		APR.DB.HideDelete = SHOW_DIALOG

 	-- else already shown, nothing to do.
 	end

-	if printconfirm then APR:PrintStatus("vendor") end;
+	if printconfirm then APR:PrintStatus("delete") end
 end -- APR:ShowPopupVendor()


 function APR:HidePopupBind(printconfirm, ForceHide)
-	APR:DebugPrint ("in APR:HidePopupBind");
+	APR:DebugPrint ("in APR:HidePopupBind")
 	if not APR.DB.HideBind or ForceHide then
 		-- Disable the dialog that pops to confirm looting BoP gear yourself.
-		APR.StoredDialogs["LOOT_BIND"] = StaticPopupDialogs["LOOT_BIND"];
-		StaticPopupDialogs["LOOT_BIND"] = nil;
+		APR.StoredDialogs["LOOT_BIND"] = StaticPopupDialogs["LOOT_BIND"]
+		StaticPopupDialogs["LOOT_BIND"] = nil

 		-- Mark that the dialog is hidden.
-		APR.DB.HideBind = HIDE_DIALOG;
+		APR.DB.HideBind = HIDE_DIALOG

 	-- else already hidden, nothing to do.
 	end

-	if printconfirm then APR:PrintStatus("loot") end;
+	if printconfirm then APR:PrintStatus("loot") end
 end -- APR:HidePopupBind()


 function APR:HidePopupRoll(printconfirm, ForceHide)
-	APR:DebugPrint ("in APR:HidePopupRoll");
+	APR:DebugPrint ("in APR:HidePopupRoll")
 	if not APR.DB.HideRoll or ForceHide then
 		-- Disable the dialog for the event that triggers when rolling on BOP items.
-		APR.StoredDialogs["CONFIRM_LOOT_ROLL"] = StaticPopupDialogs["CONFIRM_LOOT_ROLL"];
-		StaticPopupDialogs["CONFIRM_LOOT_ROLL"] = nil;
+		APR.StoredDialogs["CONFIRM_LOOT_ROLL"] = StaticPopupDialogs["CONFIRM_LOOT_ROLL"]
+		StaticPopupDialogs["CONFIRM_LOOT_ROLL"] = nil

 		-- Mark that the dialog is hidden.
-		APR.DB.HideRoll = HIDE_DIALOG;
+		APR.DB.HideRoll = HIDE_DIALOG

 	-- else already hidden, nothing to do.
 	end

-	if printconfirm then APR:PrintStatus("roll") end;
+	if printconfirm then APR:PrintStatus("roll") end
 end -- APR:HidePopupRoll()


 function APR:HidePopupVoid(printconfirm, ForceHide)
-	APR:DebugPrint ("in APR:HidePopupVoid");
+	APR:DebugPrint ("in APR:HidePopupVoid")
 	if not APR.DB.HideVoid or ForceHide then
 		-- Disable the dialog for putting tradable or modified items into void storage.
-		APR.StoredDialogs["VOID_DEPOSIT_CONFIRM"] = StaticPopupDialogs["VOID_DEPOSIT_CONFIRM"];
-		StaticPopupDialogs["VOID_DEPOSIT_CONFIRM"] = nil;
+		APR.StoredDialogs["VOID_DEPOSIT_CONFIRM"] = StaticPopupDialogs["VOID_DEPOSIT_CONFIRM"]
+		StaticPopupDialogs["VOID_DEPOSIT_CONFIRM"] = nil

 		-- Mark that the dialog is hidden.
-		APR.DB.HideVoid = HIDE_DIALOG;
+		APR.DB.HideVoid = HIDE_DIALOG

 	-- else already hidden, nothing to do.
 	end

-	if printconfirm then APR:PrintStatus("void") end;
+	if printconfirm then APR:PrintStatus("void") end
 end -- APR:HidePopupVoid()


 function APR:HidePopupVendor(printconfirm, ForceHide)
-	APR:DebugPrint ("in APR:HidePopupVendor");
+	APR:DebugPrint ("in APR:HidePopupVendor")
 	if not APR.DB.HideVendor or ForceHide then
 		-- Disable the dialog for selling group-looted items to a vendor while still tradable.
-		APR.StoredDialogs["CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL"] = StaticPopupDialogs["CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL"];
-		StaticPopupDialogs["CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL"] = nil;
+		APR.StoredDialogs["CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL"] = StaticPopupDialogs["CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL"]
+		StaticPopupDialogs["CONFIRM_MERCHANT_TRADE_TIMER_REMOVAL"] = nil
+
+		-- Mark that the dialog is hidden.
+		APR.DB.HideVendor = HIDE_DIALOG
+
+	-- else already hidden, nothing to do.
+	end
+
+	if printconfirm then APR:PrintStatus("vendor") end
+end -- APR:HidePopupVendor()
+
+
+function APR:HidePopupDelete(printconfirm, ForceHide)
+	APR:DebugPrint ("in APR:HidePopupDelete")
+	if not APR.DB.HideDelete or ForceHide then
+		-- When deleting a good item, get a yes/no dialog instead of typing the word "delete"
+		APR.StoredDialogs["DELETE_GOOD_ITEM"] = StaticPopupDialogs["DELETE_GOOD_ITEM"]
+		StaticPopupDialogs["DELETE_GOOD_ITEM"] = StaticPopupDialogs["DELETE_ITEM"]

 		-- Mark that the dialog is hidden.
-		APR.DB.HideVendor = HIDE_DIALOG;
+		APR.DB.HideDelete = HIDE_DIALOG

 	-- else already hidden, nothing to do.
 	end

-	if printconfirm then APR:PrintStatus("vendor") end;
+	if printconfirm then APR:PrintStatus("delete") end
 end -- APR:HidePopupVendor()


@@ -563,123 +629,124 @@ end -- APR:HidePopupVendor()

 -- Looting a BOP item triggers this event.
 function APR.Events:LOOT_BIND_CONFIRM(Frame, ...)
-	local id = ...;
+	local id = ...

 	if (APR.DebugMode) then
-		APR:DebugPrint ("In APR.Events:LOOT_BIND_CONFIRM");
-		APR:DebugPrint ("Frame is ", Frame);
-		APR:DebugPrint ("id is ", id);
-		APR:PrintVarArgs(...);
+		APR:DebugPrint ("In APR.Events:LOOT_BIND_CONFIRM")
+		APR:DebugPrint ("Frame is ", Frame)
+		APR:DebugPrint ("id is ", id)
+		APR:PrintVarArgs(...)
 	end -- if APR.DebugMode

 	-- If the user didn't ask us to hide this popup, just return.
 	if not APR.DB.HideBind then
-		APR:DebugPrint ("HideBind off, not auto confirming");
+		APR:DebugPrint ("HideBind off, not auto confirming")
 		return
-	end;
+	end

 	-- When harvesting (mining, herbing, or skinning) in WoD, you can get a Primal Spirit. This is a BoP item that will trigger this event when found on a mob corpse. Prior to patch 7.0.3, getting a PS while harvesting would not trigger this event (since there was never a scenario where someone else in the group could get the PS). For some reason, with 7.0.3, looting a PS on a harvest WILL trigger this event, even if you're solo. Worse, there are several problems.
 	-- 1: The parameters passed in will be wrong; it doesn't pass in the Frame; instead, the id is passed in as the first parameter.
 	-- 2: The ConfirmLootSlot() call is ignored. Effectively, it requires the user to click on the PS in the loot window to pick it up. If the user doesn't have autoloot turned on, it requires two total clicks to loot the PS.
 	-- The real fix here that this event should never trigger on a harvest; only on a kill loot. This is a Blizzard bug that has to be fixed from their end. In the meantime, I've put in the if/elseif below to handle this odd scenario.
+	-- The bug noted above was fixed some time during or after the patch 7.0.3 era.

 	if id then
-		APR:DebugPrint ("id is valid.");
-		ConfirmLootSlot(id);
+		APR:DebugPrint ("id is valid.")
+		ConfirmLootSlot(id)
 	elseif Frame then
-		APR:DebugPrint ("id is null, confirming with Frame.");
-		ConfirmLootSlot(Frame);
+		APR:DebugPrint ("id is null, confirming with Frame.")
+		ConfirmLootSlot(Frame)

 --		-- Testing whether double-Confirming would help. It didn't. :(
---		APR:DebugPrint ("Verifying if slot is empty.");
+--		APR:DebugPrint ("Verifying if slot is empty.")
 --		if LootSlotHasItem(Frame) then
---			APR:DebugPrint ("Loot slot still has item; attempting to re-loot.");
---			-- LootSlot(Frame); -- don't do this! This retriggers the same event recursively and infinitely, leading to a stack overflow.
---			ConfirmLootSlot(Frame);
+--			APR:DebugPrint ("Loot slot still has item; attempting to re-loot.")
+--			-- LootSlot(Frame) -- don't do this! This retriggers the same event recursively and infinitely, leading to a stack overflow.
+--			ConfirmLootSlot(Frame)
 --		else
---			APR:DebugPrint ("Loot slot is empty.");
+--			APR:DebugPrint ("Loot slot is empty.")
 --		end
-	end;
+	end
 end -- APR.Events:LOOT_BIND_CONFIRM()


 -- Rolling on a BOP item triggers this event.
 function APR.Events:CONFIRM_LOOT_ROLL(...)
 	if (APR.DebugMode) then
-		APR:DebugPrint ("In APR.Events:CONFIRM_LOOT_ROLL");
-		APR:PrintVarArgs(...);
+		APR:DebugPrint ("In APR.Events:CONFIRM_LOOT_ROLL")
+		APR:PrintVarArgs(...)
 	end -- if APR.DebugMode

-	local id, rollType = ...;
+	local id, rollType = ...

-	APR:DebugPrint ("id is ", id);
-	APR:DebugPrint ("rollType is ", rollType);
+	APR:DebugPrint ("id is ", id)
+	APR:DebugPrint ("rollType is ", rollType)

 	-- If the user didn't ask us to hide this popup, just return.
 	if not APR.DB.HideRoll then
-		APR:DebugPrint ("HideRoll off, not auto confirming");
+		APR:DebugPrint ("HideRoll off, not auto confirming")
 		return
-	end;
+	end

-	ConfirmLootRoll(id, rollType);
+	ConfirmLootRoll(id, rollType)
 end -- APR.Events:CONFIRM_LOOT_ROLL()


 -- Depositing an item that's modified (gemmed, enchanted, or transmogged) or a BOP item still tradable in group triggers this event.
 function APR.Events:VOID_DEPOSIT_WARNING(...)
 	if (APR.DebugMode) then
-		APR:DebugPrint ("In APR.Events:VOID_DEPOSIT_WARNING");
-		APR:PrintVarArgs(...);
+		APR:DebugPrint ("In APR.Events:VOID_DEPOSIT_WARNING")
+		APR:PrintVarArgs(...)
 	end -- if APR.DebugMode

 	-- Document the incoming parameters.
-	local slot, itemLink = ...;
-	APR:DebugPrint ("slot is ", slot);
+	local slot, itemLink = ...
+	APR:DebugPrint ("slot is ", slot)

 	-- If the user didn't ask us to hide this popup, just return.
 	if not APR.DB.HideVoid then
-		APR:DebugPrint ("HideVoid off, not auto confirming");
+		APR:DebugPrint ("HideVoid off, not auto confirming")
 		return
-	end;
+	end

 	-- prior to this event firing, the game triggers "VOID_STORAGE_DEPOSIT_UPDATE", which disables the transfer button and pops up the dialog.
 	-- So, we simulate clicking OK with the UpdateTransferButton, and pass "nil" to indicate the warning dialog isn't showing.
-	VoidStorage_UpdateTransferButton(nil);
+	VoidStorage_UpdateTransferButton(nil)
 end -- APR.Events:VOID_DEPOSIT_WARNING()


 -- Vendoring an item that was group-looted and is still tradable in the group triggers this.
 function APR.Events:MERCHANT_CONFIRM_TRADE_TIMER_REMOVAL(...)
 	if (APR.DebugMode) then
-		APR:DebugPrint ("In APR.Events:MERCHANT_CONFIRM_TRADE_TIMER_REMOVAL");
-		APR:PrintVarArgs(...);
+		APR:DebugPrint ("In APR.Events:MERCHANT_CONFIRM_TRADE_TIMER_REMOVAL")
+		APR:PrintVarArgs(...)
 	end -- if APR.DebugMode

 	-- Document the incoming parameters.
-	local item = ...; -- this is an item link.
-	APR:DebugPrint ("item is ", item);
+	local item = ... -- this is an item link.
+	APR:DebugPrint ("item is ", item)

 	-- If the user didn't ask us to hide this popup, just return.
 	if not APR.DB.HideVendor then
-		APR:DebugPrint ("HideVendor off, not auto confirming");
+		APR:DebugPrint ("HideVendor off, not auto confirming")
 		return
-	end;
+	end

 	-- Sell the item.
-	SellCursorItem();
+	SellCursorItem()
 end -- APR.Events:MERCHANT_CONFIRM_TRADE_TIMER_REMOVAL()


 -- For debugging only.
 function APR.Events:VOID_STORAGE_DEPOSIT_UPDATE(...)
 	-- We don't actually do anything in this function; it's just for debugging.
-	if (not APR.DebugMode) then return end;
+	if (not APR.DebugMode) then return end

-	APR:DebugPrint ("In APR.Events:VOID_STORAGE_DEPOSIT_UPDATE");
-	APR:PrintVarArgs(...);
+	APR:DebugPrint ("In APR.Events:VOID_STORAGE_DEPOSIT_UPDATE")
+	APR:PrintVarArgs(...)

 	-- Document the incoming parameters.
-	-- local slot = ...;
+	-- local slot = ...

 end -- APR.Events:VOID_STORAGE_DEPOSIT_UPDATE()

@@ -688,66 +755,73 @@ end -- APR.Events:VOID_STORAGE_DEPOSIT_UPDATE()
 function APR.Events:PLAYER_LOGIN(...)
 	-- Announce our load.
 	if APR.DB.PrintStartupMessage then
-		APR:ChatPrint (L["Annoying Pop-up Remover"] .. " " .. APR.Version .. " " .. L["loaded"] .. ". " .. L["For help and options, type /apr help"]);
+		APR:ChatPrint (L["Annoying Pop-up Remover"] .. " " .. APR.Version .. " " .. L["loaded"] .. ". " .. L["For help and options, type /apr help"])
 	end

 	-- Force the default Void Storage frame to load so we can override it.
-	local isloaded, reason = LoadAddOn("Blizzard_VoidStorageUI");
-	APR:DebugPrint ("Blizzard_VoidStorageUI isloaded is ", isloaded);
-	APR:DebugPrint ("Blizzard_VoidStorageUI reason is ", reason);
+	local isloaded, reason = LoadAddOn("Blizzard_VoidStorageUI")
+	APR:DebugPrint ("Blizzard_VoidStorageUI isloaded is ", isloaded)
+	APR:DebugPrint ("Blizzard_VoidStorageUI reason is ", reason)
 end -- APR.Events:PLAYER_LOGIN()


 function APR.Events:ADDON_LOADED(addon)
-	APR:DebugPrint ("Got ADDON_LOADED for " .. addon);
+	APR:DebugPrint ("Got ADDON_LOADED for " .. addon)
 	if addon == "AnnoyingPopupRemover" then
 		-- Load the saved variables, or initialize if they don't exist yet.
 		if APR_DB then
-			APR:DebugPrint ("Loading existing saved var.");
+			APR:DebugPrint ("Loading existing saved var.")
 			if nil == APR_DB.HideBind then
-				APR_DB.HideBind = SHOW_DIALOG;
-				APR:DebugPrint ("HideBind initialized to false.");
-			end;
+				APR_DB.HideBind = SHOW_DIALOG
+				APR:DebugPrint ("HideBind initialized to false.")
+			end
 			if nil == APR_DB.HideRoll then
-				APR_DB.HideRoll = SHOW_DIALOG;
-				APR:DebugPrint ("HideRoll initialized to false.");
-			end;
+				APR_DB.HideRoll = SHOW_DIALOG
+				APR:DebugPrint ("HideRoll initialized to false.")
+			end
 			if nil == APR_DB.HideVoid then
-				APR_DB.HideVoid = SHOW_DIALOG;
-				APR:DebugPrint ("HideVoid initialized to false.");
-			end;
+				APR_DB.HideVoid = SHOW_DIALOG
+				APR:DebugPrint ("HideVoid initialized to false.")
+			end
 			if nil == APR_DB.HideVendor then
-				APR_DB.HideVendor = SHOW_DIALOG;
-				APR:DebugPrint ("HideVendor initialized to false.");
-			end;
+				APR_DB.HideVendor = SHOW_DIALOG
+				APR:DebugPrint ("HideVendor initialized to false.")
+			end
+			if nil == APR_DB.HideDelete then
+				APR_DB.HideDelete = SHOW_DIALOG
+				APR:DebugPrint ("HideDelete initialized to false.")
+			end
 			if nil == APR_DB.PrintStartupMessage then
-				APR_DB.PrintStartupMessage = PRINT_STARTUP;
-				APR:DebugPrint ("PrintStartupMessage initialized to true.");
-			end;
-			APR:DebugPrint ("Applying saved settings.");
+				APR_DB.PrintStartupMessage = PRINT_STARTUP
+				APR:DebugPrint ("PrintStartupMessage initialized to true.")
+			end
+			APR:DebugPrint ("Applying saved settings.")
 			APR.DB = APR_DB
 		else
-			APR:DebugPrint ("No saved var, setting defaults.");
+			APR:DebugPrint ("No saved var, setting defaults.")
 			APR.DB = {
 				HideBind = true,
 				HideRoll = true,
 				HideVoid = true,
 				HideVendor = true,
+				HideDelete = true,
 				PrintStartupMessage = true,
-			} ;
+			}
 		end

-		APR:DebugPrint ("HideBind is " .. (APR.DB.HideBind and "true" or "false"));
-		APR:DebugPrint ("HideRoll is " .. (APR.DB.HideRoll and "true" or "false"));
-		APR:DebugPrint ("HideVoid is " .. (APR.DB.HideVoid and "true" or "false"));
-		APR:DebugPrint ("HideVendor is " .. (APR.DB.HideVendor and "true" or "false"));
+		APR:DebugPrint ("HideBind is " .. (APR.DB.HideBind and "true" or "false"))
+		APR:DebugPrint ("HideRoll is " .. (APR.DB.HideRoll and "true" or "false"))
+		APR:DebugPrint ("HideVoid is " .. (APR.DB.HideVoid and "true" or "false"))
+		APR:DebugPrint ("HideVendor is " .. (APR.DB.HideVendor and "true" or "false"))
+		APR:DebugPrint ("HideDelete is " .. (APR.DB.HideDelete and "true" or "false"))

 		-- Hide the dialogs the user has selected.
 		-- In this scenario, the DB variable is already true, but the dialog has not yet been hidden. So, we pass true to forcibly hide the dialogs.
-		if APR.DB.HideBind then APR:HidePopupBind(false, FORCE_HIDE_DIALOG) end;
-		if APR.DB.HideRoll then APR:HidePopupRoll(false, FORCE_HIDE_DIALOG) end;
-		if APR.DB.HideVoid then APR:HidePopupVoid(false, FORCE_HIDE_DIALOG) end;
-		if APR.DB.HideVendor then APR:HidePopupVendor(false, FORCE_HIDE_DIALOG) end;
+		if APR.DB.HideBind then APR:HidePopupBind(false, FORCE_HIDE_DIALOG) end
+		if APR.DB.HideRoll then APR:HidePopupRoll(false, FORCE_HIDE_DIALOG) end
+		if APR.DB.HideVoid then APR:HidePopupVoid(false, FORCE_HIDE_DIALOG) end
+		if APR.DB.HideVendor then APR:HidePopupVendor(false, FORCE_HIDE_DIALOG) end
+		if APR.DB.HideDelete then APR:HidePopupDelete(false, FORCE_HIDE_DIALOG) end

 	end -- if AnnoyingPopupRemover
 end -- APR.Events:PLAYER_LOGIN()
@@ -755,8 +829,8 @@ end -- APR.Events:PLAYER_LOGIN()

 -- Save the db on logout.
 function APR.Events:PLAYER_LOGOUT(...)
-	APR:DebugPrint ("In PLAYER_LOGOUT, saving DB.");
-	APR_DB = APR.DB;
+	APR:DebugPrint ("In PLAYER_LOGOUT, saving DB.")
+	APR_DB = APR.DB
 end -- APR.Events:PLAYER_LOGOUT()


@@ -766,13 +840,13 @@ end -- APR.Events:PLAYER_LOGOUT()

 -- Create the event handler function.
 APR.Frame:SetScript("OnEvent", function(self, event, ...)
-	APR.Events[event](self, ...); -- call one of the functions above
-end);
+	APR.Events[event](self, ...) -- call one of the functions above
+end)

 -- Register all events for which handlers have been defined
 for k, v in pairs(APR.Events) do
-	APR:DebugPrint ("Registering event ", k);
-	APR.Frame:RegisterEvent(k);
+	APR:DebugPrint ("Registering event ", k)
+	APR.Frame:RegisterEvent(k)
 end


@@ -783,5 +857,5 @@ end
 --# Local settings for debugging
 --#########################################

-APR.DebugMode = true;
+APR.DebugMode = true
 --@end-do-not-package@
diff --git a/AnnoyingPopupRemover.toc b/AnnoyingPopupRemover.toc
index 19886bb..a22abe4 100644
--- a/AnnoyingPopupRemover.toc
+++ b/AnnoyingPopupRemover.toc
@@ -1,7 +1,7 @@
 ## Interface: 70300
 ## Title: Annoying Popup Remover
 ## Version: @project-version@
-## Notes: Removes the annoying confirmation popup that appears when looting or rolling on bind-on-pickup items, or depositing modified items into void storage.
+## Notes: Removes the annoying confirmation popup that appears when looting or rolling on bind-on-pickup items, or depositing modified items into void storage, or deleting "good" items.
 ## Author: KyrosKrane Sylvanblade
 ## SavedVariablesPerCharacter: APR_DB
 ## OptionalDeps: Blizzard_VoidStorageUI