1. #1

    UIErrorsFrame mayhem

    Greetings!

    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?

    code:

    Code:
    -- 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)
                    iconframe:SetSize(iconsize, iconsize)
                    iconframe:SetBackdrop({
                            bgFile = "Interface\\TargetingFrame\\UI-RaidTargetingIcon_7"
                    })
                    iconframe:SetFrameStrata("BACKGROUND")
    				UIFrameFlash(iconframe, 0, fdur, 1, false, 0, 0)
                end
    
    
    -- non relevant code below


    AddOn Author of: SpellNotReadyYet, Rune of Powa

  2. #2
    You create a new frame every time? I'm pretty sure you were intending to create the frame once, then UIFrameFlash it whenever UI_ERROR_MESSAGE fires?
    UI & AddOns expert | Interface & Macros moderator - My work

  3. #3
    If I dont recreate a new frame everytime, all the numbers begin to overlap eachother and the frame will run its full flash before showing again if the ability is spammed which doesnt look right.

    Plus, even if I do create the frame outside the function, i still have the same issue with the error frame


    AddOn Author of: SpellNotReadyYet, Rune of Powa

  4. #4
    Are you sure that UI_ERROR_MESSAGE doesn't fire on every error message? Add a print() or similar to the event handler - it seems unlikely.
    UI & AddOns expert | Interface & Macros moderator - My work

  5. #5
    Quote Originally Posted by Treeston View Post
    Are you sure that UI_ERROR_MESSAGE doesn't fire on every error message? Add a print() or similar to the event handler - it seems unlikely.
    he said he added a print() and that altered the behavior of the frame (????)

  6. #6
    Yea I had already tried adding a print(), it fired on 80% of the messages compared to not having the print(). But its really inconsistant


    AddOn Author of: SpellNotReadyYet, Rune of Powa

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •