Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Rebel
Novice


Joined: 29 Oct 2007
Posts: 33

PostPosted: 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.
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: 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."
Reply with quote
Rebel
Novice


Joined: 29 Oct 2007
Posts: 33

PostPosted: 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?
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net