Thread Tools Display Modes
09-13-11, 10:15 AM   #1
Raeli
A Kobold Labourer
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 1
Range Colouring

I'm a little new to oUF, but I'm liking it a lot so far, the only issue I have is, when using Pitbull I had a LuaText that would turn red when out of range, and white when in range, I've been trying to edit oUF_Hank's name Tag to do this, but nothing I try seems to work - the best I could get was updating range only if I switched targets, but I can't seem to be able to get it to continually update.

If anyone could give me a simple example of how to do this, or how to do this with oUF.SpellRange (It's a little confusing, and I couldn't find any documentation on that really), that would be great.

Just to reiterate, I'm looking to set just a colour between white or red depending on range, I'm not interested in the alpha.

Cheers.
  Reply With Quote
09-14-11, 11:01 AM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Note: The following is strictly for party/raid units.

You can do this in two ways:
1. Create a tag that returns the color based on UnitInRange().
2. Use tag.frequentUpdate = 0.05 to make it poll for updates every 0.05 sec.

1. Handle the OnUpdate yourself
2. Color/Update the fontstring based on UniInRange().

If you need it for all units, then you can use SpellRange's self.SpellRange.Update function.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
09-14-11, 09:26 PM   #3
villiv
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 14
Hello Raeli and haste.

On the topic, would you consider adding a 'Update' function (with 'Override') to the Range element?
For me, simple alpha changing can be ugly solution sometimes. (ex. layered textures)

Yet no better idea to identify the out-ranged frame, so just my 2 cents.
  Reply With Quote
09-17-11, 04:15 PM   #4
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by villiv View Post
On the topic, would you consider adding a 'Update' function (with 'Override') to the Range element?
https://github.com/haste/oUF/commit/...9a2e83a33a7dd6
__________________
「貴方は1人じゃないよ」
  Reply With Quote
09-19-11, 11:54 PM   #5
villiv
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 14
Oh tyvm haste!

Now it's layout authors' turn.
We'll see what can be done by creative people with oUF's great freedom.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Range Colouring


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off