Part of my addon flashes a frame whenever the UIErrorsFrame gets a specific message (dont hate on the UIFrameFlash please ) but its giving me some really odd behaviour.
When spamming an ability, it will flash the frame 3-4 times and then just stop for like 10-15 seconds, and then flash another 3 times then stop again. I had assumed this is because the messages in the error frame are being "refreshed" and so the UI_ERROR_MESSAGE event doesnt trigger. But wait, theres more...
If i were to add a print function just after, the frame will flash a bit more often like it should do with no 10-15 second gap inbetween but will skip a few key presses when spammed.
I have tried to clear the error frame with UIErrorsFrame:Clear() after my code runs but it only makes it worse.
Any ideas what Im doing wrong?
-- non relivant code above
elseif event == "UI_ERROR_MESSAGE" then
local message = ...;
if message == "You have no target." or message == "Invalid target" then
local iconframe = CreateFrame("Frame", nil, UIParent)
iconframe:SetPoint("CENTER", xoff, yoff)
bgFile = "Interface\\TargetingFrame\\UI-RaidTargetingIcon_7"
UIFrameFlash(iconframe, 0, fdur, 1, false, 0, 0)
-- non relevant code below