Quantcast

Initial commit

p3lim-52096 [07-28-08 - 04:36]
Initial commit

git-svn-id: svn://svn.wowinterface.com/pError-161/trunk@3 7a612bb6-1b7b-4f5f-b58b-e1cc54d1b6b6
Filename
pError/pError.lua
pError/pError.toc
diff --git a/pError/pError.lua b/pError/pError.lua
new file mode 100644
index 0000000..d2d23fb
--- /dev/null
+++ b/pError/pError.lua
@@ -0,0 +1,49 @@
+--[[
+	You can find more events to add to the "blacklist" from this list:
+	http://wowcompares.com/0438606/FrameXML/GlobalStrings.lua
+
+	Just use ctrl+f (the find function)
+--]]
+
+local blacklist = {
+	SPELL_FAILED_NO_COMBO_POINTS,   -- That ability requires combo points
+	SPELL_FAILED_TARGETS_DEAD,      -- Your target is dead
+	SPELL_FAILED_SPELL_IN_PROGRESS, -- Another action is in progress
+	SPELL_FAILED_TARGET_AURASTATE,  -- You can't do that yet. (TargetAura)
+	SPELL_FAILED_CASTER_AURASTATE,  -- You can't do that yet. (CasterAura)
+	SPELL_FAILED_NO_ENDURANCE,      -- Not enough endurance
+	SPELL_FAILED_BAD_TARGETS,       -- Invalid target
+	SPELL_FAILED_NOT_MOUNTED,       -- You are mounted
+	SPELL_FAILED_NOT_ON_TAXI,       -- You are in flight
+	SPELL_FAILED_NOT_INFRONT,       -- You must be in front of your target
+	SPELL_FAILED_NOT_IN_CONTROL,    -- You are not in control of your actions
+	SPELL_FAILED_MOVING,            -- Can't do that while moving
+	ERR_ATTACK_FLEEING,				-- Can't attack while fleeing.
+	ERR_ITEM_COOLDOWN,				-- Item is not ready yet.
+	ERR_GENERIC_NO_TARGET,          -- You have no target.
+	ERR_ABILITY_COOLDOWN,           -- Ability is not ready yet.
+	ERR_OUT_OF_ENERGY,              -- Not enough energy
+	ERR_NO_ATTACK_TARGET,           -- There is nothing to attack.
+	ERR_SPELL_COOLDOWN,             -- Spell is not ready yet. (Spell)
+	ERR_OUT_OF_RAGE,                -- Not enough rage.
+	ERR_INVALID_ATTACK_TARGET,      -- You cannot attack that target.
+	ERR_OUT_OF_MANA,                -- Not enough mana
+	ERR_NOEMOTEWHILERUNNING,        -- You can't do that while moving!
+	OUT_OF_ENERGY,                  -- Not enough energy.
+}
+
+local whitelist = {
+	ERR_BADATTACKFACING,			-- You are facing the wrong way!
+}
+
+local lastEvent
+local oldUIErrorsFrame_OnEvent = UIErrorsFrame_OnEvent
+function UIErrorsFrame_OnEvent(event, msg, ...)
+	for _,text in pairs(blacklist) do
+		if(text and msg and msg == text) then return end
+	end
+	for _,text in pairs(whitelist) do
+		if(msg and msg == lastEvent and msg ~= text) then return end
+	end
+	return oldUIErrorsFrame_OnEvent(event, msg, ...)
+end
\ No newline at end of file
diff --git a/pError/pError.toc b/pError/pError.toc
new file mode 100644
index 0000000..5fa807c
--- /dev/null
+++ b/pError/pError.toc
@@ -0,0 +1,7 @@
+## Interface: 20400
+## Author: p3lim
+## Version: Revision wowi:revision
+## Title: |cffff6000p|rError
+## Notes: Hide those pesky errors!
+
+pError.lua
\ No newline at end of file