From 893eef3057bcc84cadb6d6db0acae0c25963a1d8 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 20 May 1999 22:57:47 +0000 Subject: [PATCH] Colour changes --- citadel/commands.c | 12 ++++++++++++ citadel/commands.h | 2 ++ citadel/messages.c | 2 +- citadel/routines.c | 3 +++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/citadel/commands.c b/citadel/commands.c index bd3f90da2..0840dc446 100644 --- a/citadel/commands.c +++ b/citadel/commands.c @@ -990,7 +990,19 @@ int fmout(int width, FILE * fp, char pagin, int height, int starting_lp, char su void color(int colornum) { static int is_bold = 0; + static int hold_color, current_color; + if (colornum == COLOR_PUSH) { + hold_color = current_color; + return; + } + + if (colornum == COLOR_POP) { + color(hold_color); + return; + } + + current_color = colornum; if (enable_color) { printf("\033[3%dm", (colornum % 8)); if ((colornum >= 8) && (is_bold == 0)) { diff --git a/citadel/commands.h b/citadel/commands.h index 3b615e94c..60e1403f5 100644 --- a/citadel/commands.h +++ b/citadel/commands.h @@ -19,6 +19,8 @@ #define BRIGHT_MAGENTA 13 #define BRIGHT_CYAN 14 #define BRIGHT_WHITE 15 +#define COLOR_PUSH 16 /* Save current color */ +#define COLOR_POP 17 /* Restore saved color */ /* * declarations diff --git a/citadel/messages.c b/citadel/messages.c index fbfba5c15..2749d39b0 100644 --- a/citadel/messages.c +++ b/citadel/messages.c @@ -464,7 +464,7 @@ int read_message(long int num, char pagin) /* Read a message from the server */ } } printf("\n"); - if (pagin == 1 ) color(DIM_WHITE); + if (pagin == 1) color(BRIGHT_WHITE); ++lines_printed; lines_printed = checkpagin(lines_printed,pagin,screenheight); diff --git a/citadel/routines.c b/citadel/routines.c index 0c7beb49d..636101250 100644 --- a/citadel/routines.c +++ b/citadel/routines.c @@ -90,7 +90,10 @@ int a; void hit_any_key(void) { /* hit any key to continue */ int a,b; + color(COLOR_PUSH); + color(DIM_RED); printf("%s\r",serv_info.serv_moreprompt); + color(COLOR_POP); sttybbs(0); b=inkey(); for (a=0; a