Thread Tools Display Modes
11-07-08, 06:27 AM   #221
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by saulhudson View Post
Hi guys

How can I colour the health text value by there health status.

So for say 2890 hp or 30% make the text red. Not the bar colour but the text itself.

I currently basically do this atm.

bar.value:SetText("|cff33EE44"..numberize(cur) .."|r.".. d.."%")

Which is Lyns code giving something like this 5000.50%.

Any help greatlt appreciated.
Stick this at the top of your layout somewhere.

Code:
local function ColourGradient(perc) -- for colouring in
	if perc <= 0.5 then
		return 255, perc*510, 0
	else
		return 510 - perc*510, 255, 0
	end
end
and then replace
Code:
bar.value:SetText("|cff33EE44"..numberize(cur) .."|r.".. d.."%")
with
Code:
bar.value:SetText(string.format("|cff%02x%02x%02x%s|r.%s%%", ColourGradient(min/max), numberize(cur), d)
Hope this helps.
 
11-07-08, 10:29 AM   #222
hipjipp
A Cliff Giant
 
hipjipp's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 79
Originally Posted by Errrwin View Post
Hello boys and girls.

I started using Lyn's UI for oUF and even though it is brilliant (bot Lyn's creation and oUF), I still would like one small change. As a healer I am interested in my target's missing HP instead of his current HP. What is the code for missing HP? I think (hope :P) I can change it in the LUA, but I just have no clue where to look for.

Any pointers would be greatly appreciated.
*Shameless selfpromotion*
As for a healer and oUF, i'd like to point towards my oUF layout, oUF_Kosken, it shows deficit values on all frames. Just check it out anyway
 
11-08-08, 01:43 AM   #223
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by saulhudson View Post
Hi guys

How can I colour the health text value by there health status.

So for say 2890 hp or 30% make the text red. Not the bar colour but the text itself.

I currently basically do this atm.

bar.value:SetText("|cff33EE44"..numberize(cur) .."|r.".. d.."%")

Which is Lyns code giving something like this 5000.50%.

Any help greatlt appreciated.

Originally Posted by Slakah View Post
Stick this at the top of your layout somewhere.

Code:
local function ColourGradient(perc) -- for colouring in
	if perc <= 0.5 then
		return 255, perc*510, 0
	else
		return 510 - perc*510, 255, 0
	end
end
and then replace
Code:
bar.value:SetText("|cff33EE44"..numberize(cur) .."|r.".. d.."%")
with
Code:
bar.value:SetText(string.format("|cff%02x%02x%02x%s|r.%s%%", ColourGradient(min/max), numberize(cur), d)
Hope this helps.

Using :SetText(string.format()) was replaced with :SetFormattedText() a while back.
Also, oUF has its own color gradient function, which can be used instead of creating a new one.


Code:
bar.value:SetFormattedText('|cff%02x%02x%02x%s|r%s.%%', self.ColorGradient(min/max, unpack(self.colors.smooth)), numberize(cur), d)

Last edited by p3lim : 11-08-08 at 01:49 AM.
 
11-08-08, 11:03 AM   #224
saulhudson
A Deviate Faerie Dragon
 
saulhudson's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 10
Thanks for the help folks I've tried both methods and come up with the same issue.

I get bad arguement #5 expecting string got no value? Any ideas?

Code:
bar.value:SetFormattedText('|cff%02x%02x%02x%s|r.%s%%', self.ColorGradient(min/max, unpack(self.colors.smooth)), numberize(cur), d)
Is there something else I need to pass to SetFormattedText? |cff%02x%02x%02x%s|r.%s%% this bit it total greek to me 0.0

Thanks in advance
 
11-08-08, 11:28 AM   #225
saulhudson
A Deviate Faerie Dragon
 
saulhudson's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 10
Update I got it working!!!

I did this

Code:
    if(max ~= 0) then
	r, g, b = self.ColorGradient(min/max, unpack(self.colors.smooth))
    end
and then

bar.value:SetFormattedText('|cff%02x%02x%02x%s|r.%s%%', r*255, g*255, b*255, numberize(cur), d)

which seems to be the same code as above but this works so hey presto I'm sorted!!

Thanks all.
 
11-09-08, 04:01 AM   #226
Soeters
A Warpwood Thunder Caller
 
Soeters's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 97
Hello, I'm working on my raid layout and I made the code yesterday, but when I go into raid nothing is shown and I can't see why

Here's my code
http://wowi.pastey.net/101271
 
11-09-08, 07:08 AM   #227
grimman
A Fallenroot Satyr
 
grimman's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 28
I have a bit of a problem... as usual. :P
Code:
self.RAID_ROSTER_UPDATE = updateGroup
+
Code:
local function updateGroup(self, event, unit)
	message("test")
end
Doesn't do anything at all. I'm in a raid, moving units around, updating loot rules etc, but the message never pops up.

The idea was to add a simple raid-group number on the player frame, much like Blizzard has on their own (rather crappy) unit frames. I had this on my old DUF layout which I based the oUF layout on, and I've come to miss it.

What am I doing wrong? :P
 
11-09-08, 07:12 AM   #228
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
You aren't registering the event.
 
11-09-08, 08:43 AM   #229
grimman
A Fallenroot Satyr
 
grimman's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 28
Ugh, of course... I thought that's what the first line was doing through oUF itself. I guess not. :P
 
11-09-08, 09:09 AM   #230
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
No, that just adds a function to your layout's table .
 
11-09-08, 11:13 AM   #231
Soeters
A Warpwood Thunder Caller
 
Soeters's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 97
Thanks to P3lim for my layout that works now ^^
 
11-09-08, 11:23 AM   #232
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Soeters View Post
Thanks to P3lim for my layout that works now ^^
You welcome, didnt get the time to post a reply here after fixing the pastey.
 
11-09-08, 11:50 AM   #233
grimman
A Fallenroot Satyr
 
grimman's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 28
Originally Posted by haste View Post
No, that just adds a function to your layout's table .
Thanks.
Got it working "well enough".
 
11-09-08, 02:05 PM   #234
Sojik
A Wyrmkin Dreamwalker
 
Sojik's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 53
Would anyone be willing to work on a range module? Maybe there's one in the works? I'm thinking that might be the only way to get range checks the way I'd like them. Remove Curse has a longer range than oUF can show is my problem.

Also, I am using a layout that has black bars with a red background and when I enable the range alpha it makes all the bars look red when out of range. Is there a way to fix that? I think p3lim's layout does not do this or maybe the contrast between the bars and background are just not as severe. Also on the portraits when it's faded you can see parts of the portrait that should be covered by the frame art. So, it seems like it's fading each individual layer or whatever (I'm obviously not a programmer) and not just the entire frame. If this can't be avoided, is there some other clever way to show a unit out of range? Like, change the color of the bar maybe? That'd be perfect. If something like that is already in a layout, please point me in the right direction so I can see how they did it.

Last edited by Sojik : 11-09-08 at 02:07 PM.
 
11-09-08, 09:24 PM   #235
Frumpy
A Defias Bandit
Join Date: Jul 2008
Posts: 2
Hey everyone. I'm relatively new to lua, but I'm trying to drop rock and replace chinchilla, cowtip, and pitbull with different, more efficient addons. Firstly, I'm attempting to modify p3lim's oUF layout into something more my style. Here's what I've got so far (not much):

http://hdimage.org/images/49k86pg3p7...uftroubles.png

And here's my code:

http://pastey.net/101332-3ujn

Now, what I'm trying to do is make the target's health a percentage, make the class text colored based on targeted class, put a percent health display on my pet's frame (the one above the player frame), and change the background color on every frame except target and castbar (can be seen on the pet bar. The difference is very slight and hard to see at the moment, I'm not sure how I even did that.). If possible, I'd also like to keep my health displayed as an absolute value. Right now it switches to a deficit and a percentage (could provide screenshots if needed).

Thanks for your help.
 
11-10-08, 02:04 AM   #236
Blood Druid
A Fallenroot Satyr
Join Date: Oct 2008
Posts: 26
Greetings Haste.
Whether you can write here an example how now to update Name without use tags.
I have already made as have considered necessary, but it would be desirable to see realisation of the author
 
11-10-08, 09:54 AM   #237
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Frumpy View Post
Hey everyone. I'm relatively new to lua, but I'm trying to drop rock and replace chinchilla, cowtip, and pitbull with different, more efficient addons. Firstly, I'm attempting to modify p3lim's oUF layout into something more my style. Here's what I've got so far (not much):

http://hdimage.org/images/49k86pg3p7...uftroubles.png

And here's my code:

http://pastey.net/101332-3ujn

Now, what I'm trying to do is make the target's health a percentage, make the class text colored based on targeted class, put a percent health display on my pet's frame (the one above the player frame), and change the background color on every frame except target and castbar (can be seen on the pet bar. The difference is very slight and hard to see at the moment, I'm not sure how I even did that.). If possible, I'd also like to keep my health displayed as an absolute value. Right now it switches to a deficit and a percentage (could provide screenshots if needed).

Thanks for your help.
Chinchilla, Cowtip and PitBull is not 'in-efficient' add-ons, they just have alot more options and are made to fit the average user.
While they have a bigger memory usage it doesnt have to mean anything.
Use what suits you, dont care about the usage of memory (its the CPU that counts!)
 
11-10-08, 02:39 PM   #238
Jabar
Premium Member
 
Jabar's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 8
Post

Hi !

I'm currently exporting my pitbull's layout to oUF. It's looking good so far.. so I'm quite proud of myself. \o/

Everything's working fine except one detail: I'd like the target frame to show the class icon.
Total failure on my side.

I have the path to the icons texture + the coordinates for each class in a table.
Am I supposed to register an event for PLAYER_TARGET_CHANGED then get the class value to use with my texture ? If so, where do i write it ? It's not very clear in my mind.

Thanks for your help ! =)
 
11-10-08, 03:29 PM   #239
Frumpy
A Defias Bandit
Join Date: Jul 2008
Posts: 2
Originally Posted by p3lim View Post
Chinchilla, Cowtip and PitBull is not 'in-efficient' add-ons, they just have alot more options and are made to fit the average user.
While they have a bigger memory usage it doesnt have to mean anything.
Use what suits you, dont care about the usage of memory (its the CPU that counts!)
I know, but Cowtip has had a memory leak for a while, enough to where eventually the game would be unplayable before a /reloadui. I dropped Cowtip and while I was at it, I wanted to try dropping rock entirely. I'd like to try something new.
 
11-10-08, 03:43 PM   #240
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Frumpy View Post
I know, but Cowtip has had a memory leak for a while, enough to where eventually the game would be unplayable before a /reloadui. I dropped Cowtip and while I was at it, I wanted to try dropping rock entirely. I'd like to try something new.
Id suggest TipTac for tooltips.
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF - Layout discussion

Thread Tools
Display Modes

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