diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 2fc55c341..58e792bad 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$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, @@ -155,6 +155,10 @@ curses: sometimes the message window would show a blank line after a prompt 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 @@ -228,6 +232,8 @@ curses+'perm_invent': don't highlight inventory letters since nothing is 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 diff --git a/win/curses/cursinvt.c b/win/curses/cursinvt.c index 6cb8cd67c..59b473fcb 100644 --- a/win/curses/cursinvt.c +++ b/win/curses/cursinvt.c @@ -60,8 +60,9 @@ curses_add_inv(int y, 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 */ @@ -101,19 +102,22 @@ curses_add_inv(int y, 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 " of" from " of 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) { @@ -138,10 +142,16 @@ curses_add_inv(int y, } 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); }