pick-a-color in color

Similar to how the pick-an-attribute menu for menu colors and
status highlights shows the attribute names using the attribute
so that you can see how it looks (or whether it is supported),
have the pick-a-color menu show the color names in the
corresponding color.  Does so by temporarily removing any
user-specified menu colors and setting up another list of such
for matching color names.

Forces the 'menucolors' option On while the pick-a-color menu is
in use, then restores the previous setting along with the user's
menu colorings.  Might need some way to avoid setting that for a
configuration where colors don't work.
This commit is contained in:
PatR
2020-09-10 16:01:18 -07:00
parent 5772069fb7
commit 239b7aaf66
4 changed files with 127 additions and 45 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 decl.c $NHDT-Date: 1596498154 2020/08/03 23:42:34 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.216 $ */
/* NetHack 3.7 decl.c $NHDT-Date: 1599778430 2020/09/10 22:53:50 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.217 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2009. */
/* NetHack may be freely redistributed. See license for details. */
@@ -526,17 +526,20 @@ const struct instance_globals g_init = {
0, /* distantname */
/* options.c */
NULL, /* symset_list */
(struct symsetentry *) 0, /* symset_list */
UNDEFINED_VALUES, /* mapped_menu_cmds */
UNDEFINED_VALUES, /* mapped_menu_op */
0, /* n_menu_mapped */
UNDEFINED_VALUE, /* opt_initial */
UNDEFINED_VALUE, /* opt_from_file */
UNDEFINED_VALUE, /* opt_need_redraw */
FALSE, /* opt_initial */
FALSE, /* opt_from_file */
FALSE, /* opt_need_redraw */
FALSE, /* save_menucolors */
(struct menucoloring *) 0, /* save_colorings */
(struct menucoloring *) 0, /* color_colorings */
/* pickup.c */
0, /* oldcap */
UNDEFINED_PTR, /* current_container */
(struct obj *) 0, /* current_container */
UNDEFINED_VALUE, /* abort_looting */
UNDEFINED_VALUE, /* val_for_n_or_more */
UNDEFINED_VALUES, /* valid_menu_classes */
@@ -551,7 +554,7 @@ const struct instance_globals g_init = {
0, /* saved_pline_index */
UNDEFINED_VALUES,
#endif
NULL, /* you_buf */
(char *) 0, /* you_buf */
0, /* you_buf_siz */
/* polyself.c */