diff ReAction.lua @ 279:5b9c0164a491

Fixed a number of problems with drag corners in config mode - Fixed button resizing via dragging not updating until a reload - Fixed pet/stance/vehicle buttons not always displaying in config mode - Fixed error spam when making too many pet/bag buttons
author Flick
date Wed, 11 May 2011 16:19:17 -0700
parents 36a29870bf34
children 0cb6a9944497
line wrap: on
line diff
--- a/ReAction.lua	Wed May 11 11:27:36 2011 -0700
+++ b/ReAction.lua	Wed May 11 16:19:17 2011 -0700
@@ -3,6 +3,7 @@
 local pairs = pairs
 local type = type
 local geterrorhandler = geterrorhandler
+local GetTime = GetTime
 local L = LibStub("AceLocale-3.0"):GetLocale("ReAction")
 local LKB = LibStub("LibKeyBound-1.0",true)
 if not LKB then
@@ -171,8 +172,17 @@
 
 ------ Methods ------
 
-function ReAction:UserError(msg)
-  UIErrorsFrame:AddMessage(msg)
+do
+  local lastErrorMessage
+  local lastErrorTime
+  function ReAction:UserError(msg)
+    local t = GetTime()
+    if msg ~= lastErrorMessage or lastErrorTime == nil or (t - lastErrorTime > 10) then -- prevent spam
+      UIErrorsFrame:AddMessage(msg)
+      lastErrorMessage = msg
+      lastErrorTime = t
+    end
+  end
 end
 
 function ReAction:GetBar(arg)