• 0

    posted a message on Replacing UIFrameFlash with Animations
    It seems there are still authors unaware that the use of UIFrameFlash/Fade functions are a source of taint, and it has been so for quite literally, years. These functions were never actually intended to be used by addons as can be seen by the way they are implemented.

    This is a short guide to implementing the same behaviour using the animation system.

    Replacing UIFrameFlash:
    UIFrameFlash(myFrame, fadeInTime, fadeOutTime, flashDuration, showWhenDone, flashInHoldTime, flashOutHoldTime)


    The following example assumes "myFrame" is the frame you want to flash. First, create an animation group (container) attached to your frame:
    local flasher = myFrame:CreateAnimationGroup()


    Now you need to create the animations. In this example, I flash my frame in and out. Each fade in/out lasts 0.5 seconds, totalling 1 second. My frame is currently shown but has an Alpha value of 0.

    local fade1 = flasher:CreateAnimation("Alpha")
    fade1:SetDuration(0.5)
    fade1:SetChange(1)
    fade1:SetOrder(1)

    local fade2 = flasher:CreateAnimation("Alpha")
    fade2:SetDuration(0.5)
    fade2:SetChange(-1)
    fade2:SetOrder(2)


    The :SetChange call dictates the "direction" you want to fade your frame. In this case, I used "1" to make the frame fully visible, then "-1" to make the frame transparent again.

    Now, to execute this flash all I need to call is :Play on the animation group I created.

    flasher:Play()


    That's a simple example of fading a transparent frame in and out, it will return to being transparent once the animation is finished. But what if you want it to be visible after the animation has completed? Here's how to implement the "showWhenDone" functionality.

    flasher:SetScript("OnFinished", function() myFrame:SetAlpha(1) end)


    The OnFinished script runs when your animation finishes, and in this case, makes your frame "show when done".

    Now to cover the final args, "holding" time. The animation system has an in-built delay system (:SetStartDelay, :SetEndDelay). In this case, end delay can be used to achieve both "flashOutHoldTime" and "flashInHoldTime". In the following example I've added a hold in and hold out time, lasting 1 second each, using end delays:


    -- Flashing in
    local fade1 = flasher:CreateAnimation("Alpha")
    fade1:SetDuration(0.5)
    fade1:SetChange(1)
    fade1:SetOrder(1)

    -- Holding it visible for 1 second
    fade1:SetEndDelay(1)

    -- Flashing out
    local fade2 = flasher:CreateAnimation("Alpha")
    fade2:SetDuration(0.5)
    fade2:SetChange(-1)
    fade2:SetOrder(3)

    -- Holding it for 1 second before calling OnFinished
    fade2:SetEndDelay(1)


    Now my frame will fade in over 0.5 seconds, will sit there for 1 second, will fade out over 0.5 seconds, will sit there faded out for 1 second. After that is done, it will call OnFinished.
    Posted in: Tips, FAQs, and Guides
  • 0

    posted a message on LibTimer-1.0
    For the few that are interested (~20 downloads) this is on hold for now as I discuss (hopefully) merging this with AceTimer, which would be way more ideal.
    Posted in: Libraries
  • 0

    posted a message on My UUID changed?
    http://www.wowace.com/announcements/subversion-rollbacks-for-a-subset-of-repositories/


    All affected repositories have had their UUID changed, so you will have to do
    a fresh checkout. This was done to prevent any corruption of server side
    repositories, due to limitations in how svn handles revisions.
    Posted in: Need Help?
  • 0

    posted a message on LibTimer-1.0
    Originally started as a snippet of code in Big Wigs to replace AceTimer, I figured it was generic enough to throw it into a library for others to use.

    LibTimer is a timer library based on Blizzard's animation system, rather than the OnUpdate system. It's meant to be small and simple, using the exact same API as AceTimer so swapping between the libraries is easy.

    Code is based on AceTimer and LibShefkiTimer.

    Advantages over AceTimer:
    • Theoretically more efficient as animations are handled C side.
    • Recycling of animation objects.
    • No chance of "timer pile up", avoids the dreaded "Script too long" error (unless your function actually is that large).
    • Simple id based system.
    • Support for up to 4 args instead of 1.

    Advantages over LibShefkiTimer:
    • Simple id based system.
    • Support for up to 4 args instead of 1.
    • Doesn't have unnecessary code (in my opinion) like 0 delay timers.
    • A better name.

    Why 4 args? It seemed suitable enough for Big Wigs, the addon I originally wrote this code for before it became a lib. Let's face it, anything is better than only supporting 1 arg. The lower the chances of forcing an author into creating, managing, wiping and recycling (if they even remember!) their own table the better.

    LibTimer is currently in experimental status to give me an excuse to break things before I release it (now would be a good time for criticisms). I've tested it successfully with a few of my addons and will probably release it this week.
    Posted in: Libraries
  • 0

    posted a message on BadBoy: An extremely minimal spam blocker & reporter
    Quote from Phanx
    Yes, that is 1QQ at the end instead of ICQ, and missing spaces between sentences.


    The 1 was part of the Skype ID, "QQ" is a very popular Chinese IM client.
    Posted in: General AddOns
  • 0

    posted a message on Voice chat addon
    With Mumble entirely free to host there really is no reason to use anything else. It's highly unlikely that Blizzard will offer the quality of the Opus codec or voice encryption like it does.
    Posted in: Addon Ideas
  • 0

    posted a message on Quick question on SendAddonMessage
    The new type is INSTANCE_CHAT.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Skada: a damage meter
    Quote from 420psilo
    'instance' channel needs to be updated to output the results too. other than that everthing is perfect from my end :)


    To quote what I said here: http://www.wowace.com/addons/skada/tickets/305-cannot-report-to-instance-chat-in-5-1/

    I for one vote against this. I hate idiots that spam meters in LFR, and I report them on sight.
    Posted in: General AddOns
  • 0

    posted a message on LittleWigs
    Non-MoP LW modules are broken even if they didn't have that dependency. I'm struggling for time as it is to finish MoP modules, I doubt i'll get round to fixing old ones.
    Posted in: Raid AddOns
  • 0

    posted a message on BadBoy: An extremely minimal spam blocker & reporter
    Ok latest alpha attempts to block all the fake RBG nonsense. Also updated _Guilded.
    Posted in: General AddOns
  • 0

    posted a message on The underscore is back with a vengeance
    Or if you don't want to use FindGlobals, simply set your taintLog to a value of 2 (though I recommend setting it back to 0 or 1 when you're done). That will record the "tainting" of every global variable and can help debugging which addon is the cause. Calling it "almost impossible to track down" is a bit of an overstatement. :p
    Posted in: Lua Code Discussion
  • 0

    posted a message on BadBoy: An extremely minimal spam blocker & reporter
    Yeah, he edited in the PayPal stuff after my post :P However, it would be good if people report if they are seeing the exact same messages. I'm noticing that 2 of blaze's messages are exact same as Znuff's and as far as I'm aware they are on different servers, seems suspicious.
    Posted in: General AddOns
  • 0

    posted a message on BadBoy: An extremely minimal spam blocker & reporter
    I won't be blocking boost advertisements, as far as I'm aware it's as legal as selling dungeon boosts. You'd be better off adding something to _CCleaner.

    I realize some of these probably aren't genuine players and are somehow affiliated to sites selling them for real money, so if there's actually websites being directly mentioned/advertised I'll add those.
    Posted in: General AddOns
  • 0

    posted a message on BadBoy: An extremely minimal spam blocker & reporter
    Fixed (assuming the 2nd one was also a whisper).
    Posted in: General AddOns
  • 0

    posted a message on BadBoy: An extremely minimal spam blocker & reporter
    Quote from err0rak
    v11.100


    Both of those are BoE items.

    Quote from MeEtc0
    Advertising for gambling is a big nuisance on US-Blackrock.


    Just post the exact word-for-word messages here.
    Posted in: General AddOns
  • To post a comment, please or register a new account.