1. #1
    Deleted

    Weakauras custom lua duration string?

    Howdy, i wonder if there is a way to make the duration on WA icons to display as 1m/2m/3m instead of 1:xx?
    Can this be done with some custom lua string or?
    Normally i would have used the omnicc timer but with my new font it looks like crap with the icon size i want:/
    Thanks!
    Last edited by mmocf4ab73a1dd; 2013-06-01 at 10:47 PM.

  2. #2
    WA Custom Text functions are passed the following parameters:
    Code:
    customTextFunc(region.expirationTime, region.duration, values.progress, values.duration, values.name, values.icon, values.stacks)
    So, in your Custom Text function, you'd want to do something like
    Code:
    function(expirationTime)
        local remaining = expirationTime - GetTime()
        local minutes = math.floor(remaining / 60)
        return (minutes > 0) and (minutes .. "m") or remaining
    end
    for a more in-depth explanation on what each parameter is, see: www . wowace . com/addons/weakauras/forum/21896-help-on-a-custom-function/
    (sorry, can't post links yet)

  3. #3
    Just a quick modification on what latreese said:
    Code:
    function(expirationTime)
        local remaining = expirationTime - GetTime()
        local minutes = math.floor(remaining / 60)
        return (minutes > 0) and (minutes .. "m") or (math.floor(remaining) .. "s")
    end
    Probably want to round the seconds value as well, and I added a "s" after it to be a little more clear.
    Last edited by aggixx; 2013-06-02 at 12:25 PM.


    Druid / Demon Hunter SimulationCraft Maintainer

  4. #4
    Deleted
    Thanks alot!
    One question tho, can it be done so i don't see the "s" behind but still see the "m" if it's over 1 minute?

  5. #5
    Yeah, no problem.
    Code:
    function(expirationTime)
        local remaining = expirationTime - GetTime()
        local minutes = math.floor(remaining / 60)
        return (minutes > 0) and (minutes .. "m") or math.floor(remaining)
    end


    Druid / Demon Hunter SimulationCraft Maintainer

  6. #6
    Deleted
    Quote Originally Posted by aggixx View Post
    Yeah, no problem.
    Code:
    function(expirationTime)
        local remaining = expirationTime - GetTime()
        local minutes = math.floor(remaining / 60)
        return (minutes > 0) and (minutes .. "m") or math.floor(remaining)
    end
    Awesome mate<3

Posting Permissions

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