GreenRange
I've continued to update this, because hey, why not! But I'm pretty sure tullaRange has all the same optimizations GreenRange does now. I still think it's good to have more than one range-coloring addon out there, because traditionally most of them have been bad. If there were only one choice, and it broke, we'd be screwed. So I've continued to update this, but tullaRange is also good.
Description
GreenRange turns your buttons RED when abilities are out of range. Several addons do this, but GreenRange is very efficient at it. It's "green" because it's modern and efficient, not because of the color. :P If you really like green though, you can configure it for green!
GreenRange actually has a negative performance cost, because it replaces some really inefficient code in the default UI. It's not going to increase your framerate by more than 1, but still, it works so well that it actually improves performance vs. not having it.
Profiling
If you profile range-checking addons like this, you want to look at CPU usage, not memory usage. OptionHouse can profile CPU, but its "%" metric isn't that meaningful because it's relative to the other addons you have running. "CPU/Sec" is the easiest metric to use. "CPU" is meaningful only if you a) do the timing yourself, say 60 seconds, and compare equivalent times or divide to make them equivalent, and b) /run ResetCPUUsage() first so the counting starts at zero.
Options
There's no config UI yet, but you can use /run commands to change the colors, and the setting will be saved. These are the defaults:
/run GreenRange:SetOOR_Color(1.0, 0.2, 0.2)
/run GreenRange:SetOOM_Color(0.2, 0.2, 1.0)
anyone know of an addon like this that WORKS with bartender 4?
it still works for me... don't know what you guys are doing wrong...
Could you PLEASE update this freakishly awesome addon? D:
Any word if this addon is going to be updated to work with 5.0?
not working with Bartender4--what a shame
RangeColors stoped working for me, tons of errors. Hoping to give this one a go. Any chance we could get a alpha option so the red/blue isn't so intense?
Thanks a million!
Thank you.
Well, it looks like I'm orders of magnitude worse at thinking I replied when I didn't. >.>
Insanity in optimizing something to death may be my natural state. I should probably spend more time working on config screens or something!
I like mine the most but I'm biased. :P It does profile very well though!
I swore I posted this earlier: The addon should exist, especially if its profiling better than tullaRange :)
I would not try to go too crazy with minute optimizations though. Its a sure fire way to go crazy :P
Some other things I tried that didn't work, but might be interesting.
I tried hooking :SetVertexColor on the red buttons, so they'd memorize the attempted color change, but turn it immediately back to red. This worked, and had the trick that hooksecurefunc put the hook in the object instead of the prototype, so I could nil it to unhook it later. It didn't scale well to handling OOM colors though, because that meant hooking all the buttons not just the few red ones.
I tried using :GetVertexColor instead of IsActionUsable, because the Bliz code had just set the color to be consistent with IsActionUsable. I thought this was very clever ... but it turns out the two functions have similar overhead, so there was no point.
Oh I have something I wrote up about that, and was waiting for approval before I posted the first comment. I worked on this for 5 days before I found out about tullaRange, and was somewhat disappointed since I saw you had the same main innovation of one big timer instead of N little timers. At that point I'd put too much into it to throw away though. This was a reaction to ButtonRange instead of RedRange, but I guess the two are similar enough that the result is also similar.
The main differences I see are that I replaced the flashing logic, and I have oor > oom in priority, because I treat out-of-range as its own flag that's separate from is-usable.
I'm not quite sure what to do with this. It does profile better than tullaRange, but tullaRange performs well enough that I wouldn't've written something just to try improving on it. I was trying to make something run better than ButtonRange.
I'm also sort of annoyed at how much the Blizzard code spams updates on ACTIONBAR_UPDATE_USABLE. I may try unregistered the buttons for it and handling it myself, but at that point I have to consider how much I'm replacing the buttons instead of working with them; at that point maybe what I want is just to use a bar mod that replaces everything.
I find this interesting, since we both seem to have come to the same conclusion on how to better implement RedRange (removing the ActionButton:OnUpdate stuff). Anyways, here's my version :P http://github.com/Tuller/tullaRange/tree/master//tullaRange