-$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.12 $ $NHDT-Date: 1558562367 2019/05/22 21:59:27 $
+$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.14 $ $NHDT-Date: 1558662976 2019/05/24 01:56:16 $
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,
left the prompts visible on the message line instead of erasing them
curses: support EDIT_GETLIN (but like with tty, it's disabled by default) to
pre-load an earlier response as the default answer for some prompts
+curses: when display windows get reconfigured (after setting align_status,
+ align_message, statuslines, windowborders or due to external resize),
+ the message window was being refreshed with the oldest available N
+ messages rather than most recent N. [Still room for improvement;
+ when feasible it combines short lines, resulting in N messages on
+ fewer than N lines and leaving some of the available lines blank.]
tty: re-do one optimization used when status conditions have all been removed
and remove another that tried to check whether condition text to be
displayed next was the same as the existing value; sometimes new
void
curses_last_messages()
{
- boolean border = curses_window_has_border(MESSAGE_WIN);
nhprev_mesg *mesg;
- int i, j, height, width;
+ int i, height, width;
+ int border = curses_window_has_border(MESSAGE_WIN) ? 1 : 0;
+ WINDOW *win = curses_get_nhwin(MESSAGE_WIN);
curses_get_window_size(MESSAGE_WIN, &height, &width);
+ werase(win);
+ mx = my = border;
- if (border)
- mx = my = 1;
- else
- mx = my = 0;
-
+ /*
+ * FIXME!
+ * This shouldn't be relying on a naive line count to decide where
+ * to start and stop because curses_message_win_puts() combines short
+ * lines. So we can end up with blank lines at bottom of the message
+ * window, missing out on one or more older messages which could have
+ * been included at the top.
+ *
+ * 3.6.2 showed oldest available N lines (by starting at
+ * num_mesages - 1 and working back toward 0 until window height was
+ * reached [via index 'j' which is gone now]) rather than most recent
+ * N (start at height - 1 and work way up through 0) so showed wrong
+ * lines even if N lines had been the right way to handle this.
+ */
++last_messages;
- for (j = 0, i = num_messages - 1; i > 0 && j < height; --i, ++j) {
+ i = min(height, num_messages) - 1;
+ for ( ; i > 0; --i) {
mesg = get_msg_line(TRUE, i);
if (mesg && mesg->str && *mesg->str)
curses_message_win_puts(mesg->str, TRUE);
}
curses_message_win_puts(toplines, TRUE);
--last_messages;
+
+ if (border)
+ box(win, 0, 0);
+ wrefresh(win);
}
num_messages = 0;
}
-/* Display previous message window messages in reverse chron order */
+/* Display previous messages in a popup (via menu so can scroll backwards) */
void
curses_prev_mesg()
if (!do_lifo)
curs_menu_set_bottom_heavy(wid);
curses_select_menu(wid, PICK_NONE, &selected);
+ if (selected) /* should always be null for PICK_NONE but be paranoid */
+ free((genericptr_t) selected);
curses_del_wid(wid);
}
/* create a new list element */
current_mesg = (nhprev_mesg *) alloc((unsigned) sizeof (nhprev_mesg));
current_mesg->str = dupstr(mline);
+ current_mesg->next_mesg = current_mesg->prev_mesg = (nhprev_mesg *) 0;
} else {
/* instead of discarding list element being forced out, reuse it */
current_mesg = first_mesg;