Colour changes
authorArt Cancro <ajc@citadel.org>
Thu, 20 May 1999 22:57:47 +0000 (22:57 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 20 May 1999 22:57:47 +0000 (22:57 +0000)
citadel/commands.c
citadel/commands.h
citadel/messages.c
citadel/routines.c

index bd3f90da242195d6204ce26cad7f1246e91c7739..0840dc446dfbca492a6625efff39841f180be060 100644 (file)
@@ -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)) {
index 3b615e94c628c5713f6d6d7d5db0811908cac36e..60e1403f57badb772c7c28df6acf2eaab2648d44 100644 (file)
@@ -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
index fbfba5c158ded6f8bb96cf21258a08d560205a59..2749d39b03f1e47ce8057026557501f6f020ce3d 100644 (file)
@@ -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);
 
index 0c7beb49dbb77dd0a67ed12ee0a0cc3c70b203f2..6361012502f33b958c363fe0ce7bb9824e2f00f7 100644 (file)
@@ -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<strlen(serv_info.serv_moreprompt); ++a)