shorten options.c a little by moving some color stuff out of it
creates new coloratt.c file Also, this attempts to fulfill a wish-list item by paxed, to allow naming colors in symbols file by name as an alternative to using r-g-b values. The basic color names as well as html color names are supported.
This commit is contained in:
@@ -54,4 +54,21 @@
|
||||
#define DRAGON_SILVER CLR_BRIGHT_CYAN
|
||||
#define HI_ZAP CLR_BRIGHT_BLUE
|
||||
|
||||
enum nhcolortype { no_color, nh_color, rgb_color };
|
||||
|
||||
struct nethack_color {
|
||||
enum nhcolortype colortyp;
|
||||
int tableindex;
|
||||
int rgbindex;
|
||||
const char *name;
|
||||
const char *hexval;
|
||||
long r, g, b;
|
||||
};
|
||||
|
||||
typedef struct color_and_attr {
|
||||
int color, attr;
|
||||
} color_attr;
|
||||
|
||||
#endif /* COLOR_H */
|
||||
|
||||
/*color.h*/
|
||||
|
||||
@@ -281,6 +281,26 @@ extern void all_options_statushilites(strbuf_t *);
|
||||
extern boolean status_hilite_menu(void);
|
||||
#endif /* STATUS_HILITES */
|
||||
|
||||
/* ### coloratt.c ### */
|
||||
|
||||
extern char *color_attr_to_str(color_attr *);
|
||||
extern boolean color_attr_parse_str(color_attr *, char *);
|
||||
extern int32 colortable_to_int32(struct nethack_color *);
|
||||
extern int query_color(const char *, int) NO_NNARGS;
|
||||
extern int query_attr(const char *, int) NO_NNARGS;
|
||||
extern boolean query_color_attr(color_attr *, const char *) NONNULLARG1;
|
||||
extern const char *attr2attrname(int);
|
||||
extern void basic_menu_colors(boolean);
|
||||
extern boolean add_menu_coloring_parsed(const char *, int, int);
|
||||
extern const char *clr2colorname(int);
|
||||
extern int match_str2clr(char *) NONNULLARG1;
|
||||
extern int match_str2attr(const char *, boolean) NONNULLARG1;
|
||||
extern boolean add_menu_coloring(char *) NONNULLARG1;
|
||||
extern void free_one_menu_coloring(int);
|
||||
extern void free_menu_coloring(void);
|
||||
extern int count_menucolors(void);
|
||||
extern int32 check_enhanced_colors(const char *) NONNULLARG1;
|
||||
|
||||
/* ### cmd.c ### */
|
||||
|
||||
extern void set_move_cmd(int, int);
|
||||
@@ -2238,14 +2258,6 @@ extern int add_autopickup_exception(const char *) NONNULLARG1;
|
||||
extern void free_autopickup_exceptions(void);
|
||||
extern void set_playmode(void);
|
||||
extern int sym_val(const char *) NONNULLARG1;
|
||||
extern int query_color(const char *, int) NO_NNARGS;
|
||||
extern int query_attr(const char *, int) NO_NNARGS;
|
||||
extern boolean query_color_attr(color_attr *, const char *) NONNULLARG1;
|
||||
extern const char *clr2colorname(int);
|
||||
extern int match_str2clr(char *) NONNULLARG1;
|
||||
extern int match_str2attr(const char *, boolean) NONNULLARG1;
|
||||
extern boolean add_menu_coloring(char *) NONNULLARG1;
|
||||
extern void free_menu_coloring(void);
|
||||
extern boolean msgtype_parse_add(char *) NONNULLARG1;
|
||||
extern int msgtype_type(const char *, boolean) NONNULLARG1;
|
||||
extern void hide_unhide_msgtypes(boolean, int);
|
||||
|
||||
@@ -445,9 +445,7 @@ extern struct nomakedefs_s nomakedefs;
|
||||
#define MAX_MSG_HISTORY 128 /* max # of lines in msg_history */
|
||||
#endif
|
||||
|
||||
typedef struct color_and_attr {
|
||||
int color, attr;
|
||||
} color_attr;
|
||||
#include "color.h"
|
||||
|
||||
/*
|
||||
* Version 3.7.x has aspirations of portable file formats. We
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#endif
|
||||
#include "lint.h"
|
||||
|
||||
#include "color.h"
|
||||
#include "align.h"
|
||||
#include "dungeon.h"
|
||||
#include "objclass.h"
|
||||
|
||||
Reference in New Issue
Block a user