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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: Sat Apr 11, 2009 1:42 am   

[3.05] %ansi in status window
 
I have a status window set up. I control the content of it by having a status window item. An example is:
Code:
@insclr@insstat</color>
This has worked for a long time. I load the @insclr with a trigger doing the following:
Code:
#var insclr %ansi( blue, yellow)
which assigns blue text with yellow background to it. I load @insstat with a single word. my problem is that the yellow background isn't working. I've tried %ansi( blue, red) and blue, magenta... both the red and magenta backgrounds work. Soooo either something else in my system is changing the yellow part back to black, or something is bugged. I've tried this fairly consistently.
I just tested it as well and it didn't work
procedure:
create alias called statest
Code:
#var teststat "stattest"
#var testclr %ansi( blue, yellow)

create a status bar item called teststat, check enable in status window checkbox, uncheck statusbar checkbox
Code:
@testclr@teststat</color>
execute the alias
In my session it shows up as blue with black background
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Apr 11, 2009 1:57 am   
 
Why do you have </color> at the end?

Anyway. This problem occurs because there is no ansi yellow background colour. The ANSI background colours only support the first eight colours - that is, black, grey, brown, and dark red, green, blue, magenta and cyan. The brighter colours can't be backgrounds. If you want to use them for your background colour, you'll need to use MXP, which supports any colour by its HTML name if it has one, or by its hex code (like #1F1F1A) if it doesn't.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: Sat Apr 11, 2009 2:25 am   
 
I just checked the %ansi help file, it says
Quote:
Recognized color names:
black, blue, green, cyan, red, magenta, brown, gray, yellow, white

The words "default" and "reset" will reset the colour to its default value, as in the code ESC[0m.

Examples

#SHOW %ansi(high,red)Hello %ansi(blink,blue,white)World

displays "Hello" in bright red and "World" in blinking blue letters on a white background

has the %ansi function changed since this help file was written, as it specifically says white will work and suggests yellow will (which I've used both in the past)? If so I'd flag it for updating. However my current experience with them not working would be consistent with your suggestion that they can't be used.
Also, I've used this status scheme for a couple years now, and yellow as a background has worked fine, it hasn't been until just the last couple of days that I've noticed this. Thanks for the suggestion on the workaround/rework.
As far as the the </color> I'm not sure why I have it like this, I set this up a year or two ago (don't remember the reason for it) I'd guess I did it because that's what was suggested in a forum entry or something similar. I'm also thinking it solidifies the notion that as soon as this piece of text is colored, I want to make sure it doesn't inadvertently color other stuff.....
Reply with quote
Zugg
MASTER


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

PostPosted: Sat Apr 11, 2009 5:08 pm   
 
Neither white nor yellow work right now. Technically, Fang is correct that ANSI does not have "white" or "yellow" for background colors. There are only 8 ANSI background colors, and they are all dim by default. However, I know that this did used to work and it's on my list to look at. I know zMUD had a kludge where if you used "yellow" or "white", CMUD would actually modify the "dim" color in your ANSI color preferences and would change it to the brighter color. CMUD isn't going to do that...it isn't going to change your ANSI color settings itself.

Certainly the proper way to handle this is with MXP colors. Use:
Code:
#var insclr "<color blue yellow>"

and then your above code will work (and the </color> will make sense). The other advantage of this method is that you aren't storing control characters in your variables. Your current script using %ansi is storing the raw ESC control code in the variable, which can have side effects since string variables are only supposed to store regular text.

So, while this might get fixed, I encourage you to improve your scripts to use something more supportable for the future. It also allows you to use many more colors compared to the 16 ANSI colors.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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