Perma colored background

This commit is contained in:
y4my4my4m 2023-05-12 01:15:38 +09:00
parent 63f88289f5
commit c17f3af570

View file

@ -151,6 +151,16 @@ U0 Telnet(U8 *host, U16 port=TELNET_PORT) {
I64 window_width = 80; I64 window_width = 80;
I64 window_height = 25; I64 window_height = 25;
// CDoc *doc = DocPut;
// Fs->display_doc->flags |= DOCF_SIZE_MIN;
StrCopy(Fs->task_title, "TELNET - %d:%d", host, port);
Fs->border_src = BDS_CONST;
Fs->border_attr = LTGREEN << 4 + DriveTextAttrGet(':') & 15;
Fs->text_attr = BLACK << 4 + WHITE;
Fs->title_src = TTS_LOCKED_CONST;
DocClear(Fs->border_doc, TRUE);
// LBtr(&Fs->display_flags, DISPLAYf_SHOW);
Fs->win_width = window_width; Fs->win_width = window_width;
WinHorz((TEXT_COLS / 2) - (Fs->win_width / 2), WinHorz((TEXT_COLS / 2) - (Fs->win_width / 2),
(TEXT_COLS / 2) - (Fs->win_width / 2) + (TEXT_COLS / 2) - (Fs->win_width / 2) +
@ -292,7 +302,7 @@ U0 Telnet(U8 *host, U16 port=TELNET_PORT) {
for (m = 0; m <= ansi_param_count; m++) { for (m = 0; m <= ansi_param_count; m++) {
if (ansi_code[m] <= 10) { if (ansi_code[m] <= 10) {
switch (ansi_code[m]) { switch (ansi_code[m]) {
case 0: "$$BG,BLACK$$$$WHITE$$"; isBright = FALSE; break; // reset case 0: "$$BG$$$$FG$$"; isBright = FALSE; break; // reset
case 1: isBright = TRUE; break; case 1: isBright = TRUE; break;
case 2: isBright = FALSE; break; case 2: isBright = FALSE; break;
} }
@ -310,8 +320,7 @@ U0 Telnet(U8 *host, U16 port=TELNET_PORT) {
case 35: "$$PURPLE$$"; break; case 35: "$$PURPLE$$"; break;
case 36: "$$CYAN$$"; break; case 36: "$$CYAN$$"; break;
case 37: "$$WHITE$$"; break; case 37: "$$WHITE$$"; break;
case 39: "$$WHITE$$"; break; // reset case 39: "$$FG$$"; break;
// case 39: "$$FG$$"; break; // would normally call $$FG$$ but telnet actually resets to white
default: break; default: break;
} }
} }
@ -333,7 +342,7 @@ U0 Telnet(U8 *host, U16 port=TELNET_PORT) {
case 36: "$$LTCYAN$$"; break; case 36: "$$LTCYAN$$"; break;
case 97: case 97:
case 37: "$$LTGRAY$$"; break; case 37: "$$LTGRAY$$"; break;
case 39: "$$WHITE$$"; break; // reset case 39: "$$FG$$"; break;
default: break; default: break;
} }
} }
@ -353,8 +362,7 @@ U0 Telnet(U8 *host, U16 port=TELNET_PORT) {
case 45: "$$BG,PURPLE$$"; break; case 45: "$$BG,PURPLE$$"; break;
case 46: "$$BG,CYAN$$"; break; case 46: "$$BG,CYAN$$"; break;
case 47: "$$BG,WHITE$$"; break; case 47: "$$BG,WHITE$$"; break;
case 49: "$$BG,BLACK$$"; break; // reset case 49: "$$BG$$"; break; // reset
// case 49: "$$BG$$"; break; // would normally call $$BG$$ but telnet actually resets to black
default: break; default: break;
} }
} }
@ -376,8 +384,7 @@ U0 Telnet(U8 *host, U16 port=TELNET_PORT) {
case 46: "$$BG,LTCYAN$$"; break; case 46: "$$BG,LTCYAN$$"; break;
case 107: case 107:
case 47: "$$BG,LTGRAY$$"; break; case 47: "$$BG,LTGRAY$$"; break;
case 49: "$$BG,BLACK$$"; break; // reset case 49: "$$BG$$"; break; // reset
// case 49: "$$BG$$"; break; // would normally call $$BG$$ but telnet actually resets to black
default: break; default: break;
} }
} }
@ -401,13 +408,14 @@ U0 Telnet(U8 *host, U16 port=TELNET_PORT) {
case 'C': case 'C':
// Cursor Right // Cursor Right
// SysLog("Cursor Right %d %d\n", ansi_param_count, ansi_code[0]); // SysLog("Cursor Right %d %d\n", ansi_param_count, ansi_code[0]);
// "$$CM,%d,0$$", ansi_code[0]; "$$CM,%d,0$$", ansi_code[0];
// NOTE: this has been "fixed" since we now change the window's background color
// if we just move the cursor, // if we just move the cursor,
// you dont get the colored background since we skip over it directly // you dont get the colored background since we skip over it directly
I64 C; // I64 C;
for (C = 0; C < ansi_code[0]; C++) { // for (C = 0; C < ansi_code[0]; C++) {
" "; // " ";
} // }
ptr++; ptr++;
break; break;
case 'D': case 'D':