Add menucolors

-Add a boolean option menucolors to toggle menu color
-Add MENUCOLOR -config file option

TODO:
-Better support for win32
-Support more windowports
-Update Guidebook
-Allow changing menucolor lines in-game
This commit is contained in:
Pasi Kallinen
2015-03-17 22:50:11 +02:00
parent 9f66b234ed
commit c8e781c418
15 changed files with 253 additions and 1 deletions

View File

@@ -7,6 +7,10 @@
#ifndef COLOR_H
#define COLOR_H
#ifdef MENU_COLOR_REGEX
#include <regex.h>
#endif
/*
* The color scheme used is tailored for an IBM PC. It consists of the
* standard 8 colors, folowed by their bright counterparts. There are
@@ -51,4 +55,18 @@
#define DRAGON_SILVER CLR_BRIGHT_CYAN
#define HI_ZAP CLR_BRIGHT_BLUE
struct menucoloring {
# ifdef MENU_COLOR_REGEX
# ifdef MENU_COLOR_REGEX_POSIX
regex_t match;
# else
struct re_pattern_buffer match;
# endif
# else
char *match;
# endif
int color, attr;
struct menucoloring *next;
};
#endif /* COLOR_H */

View File

@@ -437,6 +437,14 @@ typedef unsigned char uchar;
* bugs left here.
*/
/* Menucolors */
# define MENU_COLOR_REGEX /* use GNU regex */
/*# define MENU_COLOR_REGEX_POSIX*/ /* use POSIX regex */
/* if neither is defined, uses pmatch()
* pmatch() provides basic globbing: '*' and '?' wildcards.
*/
#define STATUS_VIA_WINDOWPORT /* re-work of the status line updating process */
#define STATUS_HILITES /* support hilites of status fields */
/* #define WINCHAIN*/ /* stacked window systems */

View File

@@ -1583,6 +1583,9 @@ E void FDECL(parsesymbols, (char *));
E struct symparse *FDECL(match_sym, (char *));
E void NDECL(set_playmode);
E int FDECL(sym_val, (char *));
E boolean FDECL(add_menu_coloring, (char *));
E boolean FDECL(get_menu_coloring, (char *, int *, int *));
E void NDECL(free_menu_coloring);
/* ### pager.c ### */

View File

@@ -201,6 +201,7 @@ struct instance_flags {
boolean rlecomp; /* run-length comp of levels when writing savefile */
uchar num_pad_mode;
boolean echo; /* 1 to echo characters */
boolean use_menu_color; /* use color in menus; only if wc_color */
#if 0
boolean DECgraphics; /* use DEC VT-xxx extended character set */
boolean IBMgraphics; /* use IBM extended character set */