|
Rebel Novice
Joined: 29 Oct 2007 Posts: 33
|
Posted: Fri Mar 28, 2008 6:11 pm
How to change colour of a Status Bar variable? |
I capture my health points in a trigger, and display it in my status bar.
Is it possible to make the colour of a displayed variable change with the variables value?
For instance, if my @HP variable was over 1000 - I would like it to be green text.
Between 500-1000 yellow text
Less than 500 red text.
Any help appreciated. |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Fri Mar 28, 2008 6:27 pm |
Code: |
<c %if(@HP<500,"red",%if(@HP>1000,"green","yellow"))>@HP</c> |
You could also change the background to have the colours "pop" a little more
Code: |
<c %if(@HP<500,"red",%if(@HP>1000,"green","yellow")) "black">@HP</c> |
Or keep the text black and change the background to red green or yellow
Code: |
<c "black" %if(@HP<500,"red",%if(@HP>1000,"green","yellow")) >@HP</c> |
|
|
_________________ -Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style." |
|
|
|
Rebel Novice
Joined: 29 Oct 2007 Posts: 33
|
Posted: Fri Mar 28, 2008 6:42 pm |
That worked GREAT! Many thanks.
I then searched the cMud documentation for a <c> - and found nothing. Where do I find these commands/tags?
ps.. can I make the colours bold as well? |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Fri Mar 28, 2008 6:43 pm |
He was using MXP c being short for color
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
|
|