getpos() highlighting of valid positions

Redo getpos() highlighting.  If bgcolors is Off, '$' toggles between
no highlighting and showing dollar signs at valid spots.  ^R removes
those if they're present.  When bgcolors is On, '$' cycles among
three settings:  highlighting via background color, no highlighting,
and highlighting by drawing dollar sign characters.  ^R switches to
background color mode.

This doesn't directly solve the problem of background color causing
conflict with the foreground color of some objects or monsters, but
being able to get rid of the background with a keystroke should be an
improvement.

'bgcolors' defaults to On, which was a problem for tty when 'color'
was Off.  Turn it Off (in the core) for text map if color is Off and
bgcolors hasn't been explicitly set.  Conversely, Qt was leaving
color Off and then using color with abandon.  Turn in On (in the core)
for tiled map if it hasn't been given an explicit value.  Those two
changes should cope with most situations and still let the player
override.
This commit is contained in:
PatR
2024-02-16 14:56:20 -08:00
parent 2e64d35dd2
commit 1d5f45aa78
2 changed files with 75 additions and 58 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 options.c $NHDT-Date: 1701499956 2023/12/02 06:52:36 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.685 $ */
/* NetHack 3.7 options.c $NHDT-Date: 1708124177 2024/02/16 22:56:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.707 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2008. */
/* NetHack may be freely redistributed. See license for details. */
@@ -7043,6 +7043,12 @@ initoptions_finish(void)
&& wc_supported("tiled_map"))
iflags.wc_ascii_map = FALSE, iflags.wc_tiled_map = TRUE;
if (iflags.wc_tiled_map && !opt_set_in_config[opt_color])
iflags.wc_color = TRUE;
if (iflags.wc_ascii_map && !iflags.wc_color
&& !opt_set_in_config[opt_bgcolors])
iflags.bgcolors = FALSE;
#ifdef ENHANCED_SYMBOLS
if (glyphid_cache_status())
free_glyphid_cache();