-$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.105 $ $NHDT-Date: 1567240693 2019/08/31 08:38:13 $
+$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.106 $ $NHDT-Date: 1567273590 2019/08/31 17:46:30 $
This fixes36.3 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.2 in May 2019. Please note, however,
curses: the change to show map in columns 1..79 instead of 2..80 made the
highlight for '@' show up in the wrong place if clipped map had been
panned horizontally
+curses+'perm_invent': menu coloring patterns which match ordinary inventory
+ menu might fail to match persistent inventory window because leading
+ article and space ("a ", "an ", "the ") is stripped off for brevity;
+ perform the pattern matching tests before stripping doname() prefix
tty: revert the attempt to fix "message line anomaly: if autodecribe feedback
wrapped to second line, the wrapped portion wasn't erased when a
shorter line was shown or getpos was dismissed" because it disrupted
curses+'perm_invent': could crash during restore if game was saved while
hero was swallowed (invalid u.ustuck pointer; suppressing attempts to
update persistent inventory window during restore hides the problem)
+curses+'perm_invent': menu coloring required that both 'menucolors' and
+ 'guicolor' be On; override guicolor with more-specific menucolors
curses+'popup_dialog': show the text cursor at the end of prompts for single
character input
curses+DUMPLOG: pass along old messages from save file and quest message
CHAR_P accelerator, attr_t attr, const char *str)
{
WINDOW *win = curses_get_nhwin(INV_WIN);
+ boolean save_guicolor;
int color = NO_COLOR;
- int x = 0, width, height, available_width,
+ int x = 0, width, height, available_width, stroffset = 0,
border = curses_window_has_border(INV_WIN) ? 1 : 0;
/* Figure out where to draw the line */
persistent inventory window so don't highlight inventory letters */
wprintw(win, "%c) ", accelerator);
#endif
- available_width -= 3;
+ available_width -= 3; /* letter+parenthesis+space */
/* narrow the entries to fit more of the interesting text; do so
unconditionally rather than trying to figure whether it's needed;
when 'sortpack' is enabled we could also strip out "<class> of"
from "<prefix><class> of <item><suffix> but if that's to be done,
- core ought to do it */
+ core ought to do it;
+ 'stroffset': defer skipping the article prefix until after menu
+ color pattern matching has taken place so that the persistent
+ inventory window always gets same coloring as regular inventory */
if (!strncmpi(str, "a ", 2))
- str += 2;
+ stroffset = 2;
else if (!strncmpi(str, "an ", 3))
- str += 3;
+ stroffset = 3;
else if (!strncmpi(str, "the ", 4))
- str +=4;
+ stroffset = 4;
}
#if 0 /* FIXME: MENU GLYPHS */
if (accelerator && glyph != NO_GLYPH && iflags.use_menu_glyphs) {
}
if (color == NO_COLOR)
color = NONE;
+ /* curses_toggle_color_attr() uses 'guicolor' to decide whether to
+ honor specified color, but persistent inventory window has its own
+ more-specific control, 'menucolors', so override with that here */
+ save_guicolor = iflags.wc2_guicolor;
+ iflags.wc2_guicolor = iflags.use_menu_color;
curses_toggle_color_attr(win, color, attr, ON);
/* wattron(win, attr); */
- wprintw(win, "%.*s", available_width, str);
+ wprintw(win, "%.*s", available_width, str + stroffset);
/* wattroff(win, attr); */
curses_toggle_color_attr(win, color, attr, OFF);
+ iflags.wc2_guicolor = save_guicolor;
wclrtoeol(win);
}