Change menu_headings to accept color and attribute

Instead of just accepting an attribute, it's now possible to
use a color, or both color and attribute, for example:

OPTIONS=menu_headings:inverse
OPTIONS=menu_headings:red
OPTIONS=menu_headings:red&underline

Default is still just inverse.
This lets the player change the menu heading color without
needing to use menu colors for them.

Also makes it so the core uses NO_COLOR instead of 0, for all
the menu lines which don't have any prefedefined color.

Tested for tty, curses, x11, qt, and win32
This commit is contained in:
Pasi Kallinen
2023-11-13 07:33:48 +02:00
parent dd6c249a8c
commit dd5ca5b058
47 changed files with 251 additions and 150 deletions

View File

@@ -989,7 +989,7 @@ query_objlist(const char *qstr, /* query string */
unsigned sortflags;
glyph_info tmpglyphinfo = nul_glyphinfo;
Loot *sortedolist, *srtoli;
int clr = 0;
int clr = NO_COLOR;
*pick_list = (menu_item *) 0;
if (!olist && !engulfer)
@@ -1188,7 +1188,7 @@ query_category(
boolean (*ofilter)(OBJ_P) = (boolean (*)(OBJ_P)) 0;
boolean do_unpaid = FALSE, do_blessed = FALSE, do_cursed = FALSE,
do_uncursed = FALSE, do_buc_unknown = FALSE, verify_All = FALSE;
int num_buc_types = 0, num_justpicked = 0, clr = 0;
int num_buc_types = 0, num_justpicked = 0, clr = NO_COLOR;
*pick_list = (menu_item *) 0;
if (!olist)
@@ -2055,7 +2055,7 @@ doloot_core(void)
int prev_inquiry = 0;
boolean prev_loot = FALSE;
int num_conts = 0;
int clr = 0;
int clr = NO_COLOR;
ga.abort_looting = FALSE;
@@ -3251,7 +3251,7 @@ in_or_out_menu(
char buf[BUFSZ];
int n;
const char *menuselector = flags.lootabc ? abc_chars : lootchars;
int clr = 0;
int clr = NO_COLOR;
any = cg.zeroany;
win = create_nhwindow(NHW_MENU);
@@ -3378,7 +3378,7 @@ dotip(void)
anything any;
menu_item *pick_list = (menu_item *) 0;
struct obj dummyobj, *otmp;
int clr = 0;
int clr = NO_COLOR;
any = cg.zeroany;
win = create_nhwindow(NHW_MENU);
@@ -3701,7 +3701,7 @@ tipcontainer_gettarget(
menu_item *pick_list = (menu_item *) 0;
struct obj dummyobj, *otmp;
boolean hands_available = TRUE, exclude_it;
int clr = 0;
int clr = NO_COLOR;
#if 0 /* [skip potential early return so that menu response is needed
* regardless of whether other containers are being carried] */