• 0

    posted a message on Grid
    In AB the unit name is colored depending on the status of the flag they're near, so 5 colors (more if you factor in alpha). In WSG units are red at the horde end and blue at the alliance end. In the middle the unit's color changes smoothly from blue to grey to red depending on where they are (see picture).

    At the moment these colors are just passed directly to SetTextColor(). I've done a solution where colors are stored in a weak table and are collected when Grid is finished with them (lifted wholesale from Programming in Lua 17.1). This would create a maximum of one new table per OnUpdate (my addon processes one unit per OnUpdate). The alternative would be to round the color numbers to the nearest 0.05 or whatever, which would produce fewer discrete colors and tables, and fewer update events for Grid. I'm not sure if this is necessary though.
    Posted in: Grid & Grid2
  • 0

    posted a message on Grid
    Quote from Mokhtar
    old.wowace.com


    Thank you. I've just about got my status module working. One of the things the module does is change the status color based on the unit's position. There was a bit of unexpected behaviour because created one color table, used it as an upvalue, populated it and sent it to GridStatus:SendStatusGained. The code in SendStatusGained goes:

        if cached and
            cached.priority == priority and
            cached.range == range and
            cached.color == color and
    
    ...

    This checks whether the color table is the same table reference as the cached one and not whether the actual colors are the same.

    Would this be considered an issue at your end, or is dynamic color changing not common enough to be worth worrying about? I'm formulating a solution at my end which involves my first use of weak tables, which is sort of exciting :)
    Posted in: Grid & Grid2
  • 0

    posted a message on Grid
    Sorry to post here, I'm wondering what the best resource for developers wanting to do a status module is. I remember there used to be a page on wowace.com that I can no longer find, and Google has utterly failed me. Thanks!
    Posted in: Grid & Grid2
  • 0

    posted a message on Grid
    Hi, I got a bit of taint happening today. I have to say I was relieved it wasn't the addon I was testing :-)

    Here's the taint log, I didn't notice any problems with functionality.

    One possible cause could have been that I was in Arathi Basin with the Raid 10 layout hanging over from WSG. Cheers!
    Posted in: Grid & Grid2
  • To post a comment, please or register a new account.