Hey DM,
I have a fix for frame.js - I noticed an issue that \1n was not reseting back to normal (normal being black background).
Eg: I had this:
const frame = new Frame(1,1,console.screen_columns,console.screen_rows,BG_BLACK|LIGHTGRAY); frame.gotoxy(1,1);
frame.putmsg(test);
and if test was sending something like \1n\17\1kfoo\1nbar, "bar" would still have a white background with black text.
This patch changes the background back to black when putmsg sees \n.
Re: Fix for frame.js
By: alterego to Digital Man on Sat Jul 25 2020 11:39 pm
Hey DM,
I have a fix for frame.js - I noticed an issue that \1n was not reseting back to normal (normal being black background).
Eg: I had this:
const frame = new Frame(1,1,console.screen_columns,console.screen_rows,BG_BLACK|LIGHTGRAY); frame.gotoxy(1,1);
frame.putmsg(test);
and if test was sending something like \1n\17\1kfoo\1nbar, "bar" would still have a white background with black text.
This patch changes the background back to black when putmsg sees \n.
But putmsg() should return the current attribute even on the next line, no? That's how console.putmsg() works.
const frame = new
Frame(1,1,console.screen_columns,console.screen_rows,BG_BLACK|LIGHTGRA
Y); frame.gotoxy(1,1);
frame.putmsg(test);
and if test was sending something like \1n\17\1kfoo\1nbar, "bar" would
still have a white background with black text.
But putmsg() should return the current attribute even on the next line, no? That's how console.putmsg() works.
Or maybe you meant to write: "when putmsg sees \1n".This patch changes the background back to black when putmsg sees \n.
Re: Fix for frame.js
By: Digital Man to alterego on Sun Jul 26 2020 07:29 pm
const frame = new
Frame(1,1,console.screen_columns,console.screen_rows,BG_BLACK|LIGHTGRA
Y); frame.gotoxy(1,1);
frame.putmsg(test);
and if test was sending something like \1n\17\1kfoo\1nbar, "bar" would
still have a white background with black text.
But putmsg() should return the current attribute even on the next line, no? That's how console.putmsg() works.
Well, I'm not sure.
Without my patch, writing to a frame (I'm using frame.putmsg() not console.putmsg()), \n was not reseting the color - in fact the patch I gave you was just resetting the background color, but I see that I had to update it to reset the foreground color as well.
I'm not clear why a '\n' should reset any colors at all. <shrug>
Re: Fix for frame.js
By: Digital Man to alterego on Sat Aug 01 2020 12:23 pm
I'm not clear why a '\n' should reset any colors at all. <shrug>
I was working on what happens with console.putmsg() vs frame.putmsg().
Take this snippet:
load('frame.js'); console.putmsg('\1h\1Rblack/red\x017\1kgray/black\1nblack/red?');
foo = new Frame(1,4,80,5,BG_BLACK|LIGHTGRAY); foo.putmsg('\1h\1Gblack/green\x017\1kgray/black\1nblack/green?'); foo.open();
foo.cycle();
It should render 3 pairs of 2 words - the words being the background/forground color.
In the first case (console.putmsg):
* black/red is red text on a black background
* gray/black is black text on a gray background
* black/red? is NOT red text on a black background, but rather gray text on a black ground.
IE: \n appears to have reset the colors to back background with gray text.
In the second case, using frame:
* black/green is in fact green text on a black background
* gray/black is in fact black text on a gray background
* black/green is NOT green text on a black background, but rather black text on a gray background.
IE: \n appears to have reset the foreground color only
(This is prior to the patches I provided you.)
My patch for frame.js that I provided you was to have frame.putmsg be consistent with console.putmsg().
If \n should not reset any colors at all, why does it in this case?
Are we still conflating \1n with \n?
A '\n' should not be resetting any colors and I don't see any \n's in your example code above.
Re: Fix for frame.js
By: Digital Man to alterego on Sat Aug 01 2020 11:42 pm
Are we still conflating \1n with \n?
Yup, my bad - I do mean \1n.
A '\n' should not be resetting any colors and I don't see any \n's in your example code above.
So am I right - \1n should reset the colors to black background and white foreground?
So am I right - \1n should reset the colors to black background and white foreground?
So am I right - \1n should reset the colors to black background and
white foreground?
no. that just makes it a 'dark' version of the current fg color.
Re: Fix for frame.js
By: alterego to Digital Man on Sun Aug 02 2020 05:28 pm
So am I right - \1n should reset the colors to black background and white foreground?
no. that just makes it a 'dark' version of the current fg color.
it might change the bg to black though.
\1h\1w is bright white
\1r\1n is dark red
it might change the bg to black though.
\1h\1w is bright white
\1r\1n is dark red
That is incorrect. A Ctrl-AN reverts all attributes to "normal", lightgray on black, non-blinking.
Sysop: | tracker1 |
---|---|
Location: | Phoenix, AZ |
Users: | 54 |
Nodes: | 25 (0 / 25) |
Uptime: | 120:14:03 |
Calls: | 367 |
Files: | 1,364 |
Messages: | 36,299 |