|
herbster69 Newbie
Joined: 20 Nov 2009 Posts: 8
|
Posted: 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, |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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>} |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
herbster69 Newbie
Joined: 20 Nov 2009 Posts: 8
|
Posted: 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! |
|
|
|
|
|