• 0

    posted a message on Changing color of buff duration text
    Quote from stako04
    I'm working with *this* and I'm trying to figure out how to change the color of the buff duration text and have it set to different colors based on the duration. For example, if the duration is < 60 sec, make the font color red, if it's greater than 60 sec and less than 1 hour, make it blue, if its greater than 1 hour, make it white.

    The language you're using can translate almost directly into code. Assuming duration is in seconds:

    [php] if duration < 60 then
    color = red
    elseif duration < 3600 then
    color = blue
    color = white

    As for where to do that, it doesn't look like the text color is set in the addon you posted. That appears to be an addon that modifies another addon. You'll need to search that other addon for where it calls[FONT=monospace] S[/FONT]econdsToTimeAbbrev, and you should be pretty close.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Might someone be able to help me?
    Quote from Torhal
    Ugh. I don't have the newline problem, but I'm using XEmacs...

    No newline problem with Vim either.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Might someone be able to help me?
    Ok, well as a variable name for a table, doesn't it have to be defined somewhere what table it's a name for?
    Yes, but it doesn't have to be in a variable named 'filter', it doesn't have to be in a variable at all. Someone could call that function like filterwordsonly('foobar',{}) and it's receiving a brand new table, or they could say filterwordsonly() and 'filter' would be nil.

    [php] local mytable = {}
    local foo = mytable
    local bar = foo
    local function somefunc(widget,filter)
    table.insert(widget, 'apple')
    table.insert(filter, 'donut')
    somefunc(foo, bar)
    for k,v in pairs(mytable) do
    end[/php]We have 5 variable here (mytable, foo, bar, widget, filter) that all refer to the exact same table.

    To find out what table 'filter' refers to, you need to look at where filterwordsonly is being called and see what the caller passes in.
    Posted in: Lua Code Discussion
  • 0

    posted a message on [Pitbull] A few Discord conversion questions...
    I'm trying to replicate my current Discord unit frames to Pitbull. I have two issues:


    My Discord frames (bottom) have the HP deficit on the right of the health bar. This is right justified (i.e. it grows from right to left). If it grows long enough, it can overlap the regular HP text. That's what I want.

    With my Pitbull version, the text is being truncated, presumably because it would otherwise overlap with the HP text. The deficit text is a new text object, anchored to the right of the health bar... why is being affected by the HP text at all? How do I change this and make it a truly independent entity?


    Pitbull puts the buff timers on the buff icon itself, which is well neigh unreadable. I'd much prefer to have it offset, like I do in my Discord config. Am I going to have to hack the source for this?

    Thanks in advance for your help! :)
    Posted in: Unit Frames
  • To post a comment, please or register a new account.