Quantcast

Add posibility to just add everything that comes at once

Adrian L Lange [06-13-11 - 01:57]
Add posibility to just add everything that comes at once
Filename
pError.lua
diff --git a/pError.lua b/pError.lua
index 601f44b..1261e3c 100644
--- a/pError.lua
+++ b/pError.lua
@@ -13,6 +13,8 @@ local addonName = ...

 local find, lower = string.find, string.lower

+local LISTENING = false
+
 local addon = CreateFrame('Frame', addonName)
 local orig = UIErrorsFrame:GetScript('OnEvent')

@@ -29,6 +31,9 @@ local function slashCommand(str)
 		else
 			print('|cffff8080pError:|r Database is empty')
 		end
+	elseif(str == 'listen') then
+		LISTENING = not LISTENING
+		print('|cffff8080pError:|r Listening to any errors now ', LISTENING and 'enabled' or 'disabled')
 	elseif(#str > 0) then
 		for k, v in pairs(pErrorDB) do
 			if(find(str, v)) then
@@ -49,6 +54,11 @@ local function errorEvent(self, event, str, ...)
 				return
 			end
 		end
+
+		if(LISTENING) then
+			table.insert(pErrorDB, str)
+			print('|cffff8080pError:|r Added|cff95ff95', str, '|rto database')
+		end
 	end

 	return orig(self, event, str, ...)