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
herbster69
Newbie


Joined: 20 Nov 2009
Posts: 8

PostPosted: Fri Dec 04, 2009 4:52 pm   

Assigning colours to Status Window lines from stringlists
 
Hi there,

I use the following command to update my status window:

#STW {%expandlist( @afflictions, %char( 10))} "" Afflictions

I would ideally like to colour all the records in the stringlist variable which start with 'No' a different colour to all the other records when they're displayed in the Status Window. How would I go about doing this (assuming it's possible)?

Thanks,
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Dec 04, 2009 5:10 pm   
 
Take a look at the %ansi function, or use the MXP COLOR tag.

#SAY {%ansi(red)this text is red}
#SAY {<COLOR red>this text is red</COLOR>}
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Dec 04, 2009 5:53 pm   
 
You need to put the colorizing code into your data. This is great if you're doing something that doesn't require a specific line format, because CMud processes the color codes in the output instead of printing them out. However, if you DO need to use %format() then the format string will include the raw, unprocessed color code as part of the data--which can throw off the length calculations and mess up your formatting.

If you can't/won't put color data into your variable, you have to stop using %expandlist() and figure out a different way.
_________________
EDIT: I didn't like my old signature
Reply with quote
herbster69
Newbie


Joined: 20 Nov 2009
Posts: 8

PostPosted: Fri Dec 04, 2009 6:28 pm   
 
Thanks all. I created 2 stringlists and status windows and like this:

#STW {%ansi(high,red)"AFFLICTIONS"%char( 10)%ansi(reset)%expandlist( @afflictions, %char( 10))%char( 10)} "" Afflictions
#STW {%ansi(high,green)"DEFENCES"%char( 10)%ansi(reset)%expandlist( @defences, %char( 10))} "" Defences

and it all works fine!
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