diff --git a/win/curses/cursmain.c b/win/curses/cursmain.c index da04e639f..c78433355 100644 --- a/win/curses/cursmain.c +++ b/win/curses/cursmain.c @@ -18,6 +18,7 @@ extern char erase_char, kill_char; #endif extern long curs_mesg_suppress_turn; /* from cursmesg.c */ +extern boolean curs_mesg_suppress_suppression; /* ditto */ /* stubs for curses_procs{} */ #ifdef POSITIONBAR @@ -500,8 +501,10 @@ curses_putstr(winid wid, int attr, const char *text) /* this is comparable to tty's cw->flags &= ~WIN_STOP; if messages are being suppressed after >>ESC, override that and resume showing them */ - if ((mesgflags & ATR_URGENT) != 0) + if ((mesgflags & ATR_URGENT) != 0) { curs_mesg_suppress_turn = -1L; + curs_mesg_suppress_suppression = TRUE; + } if (wid == WIN_MESSAGE && (mesgflags & ATR_NOHISTORY) != 0) { /* display message without saving it in recall history */ @@ -511,6 +514,9 @@ curses_putstr(winid wid, int attr, const char *text) curses_attr = curses_convert_attr(attr); curses_puts(wid, curses_attr, text); } + + /* urgent message handling is a one-shot operation; we're done */ + curs_mesg_suppress_suppression = FALSE; } /* Display the file named str. Complain about missing files diff --git a/win/curses/cursmesg.c b/win/curses/cursmesg.c index 093c78a18..c63932ab4 100644 --- a/win/curses/cursmesg.c +++ b/win/curses/cursmesg.c @@ -21,6 +21,11 @@ extern char erase_char, kill_char; for the current move; but hero might get more than one move per turn, so the input routines need to be able to cancel this */ long curs_mesg_suppress_turn = -1L; +/* if a message is marked urgent, existing suppression will be overridden + so that messages resume being shown; this is used in case the urgent + message triggers More>> for the previous message and the player responds + with ESC; we need to avoid initiating suppression in that situation */ +boolean curs_mesg_suppress_suppression = FALSE; /* Message window routines for curses interface */ @@ -109,9 +114,10 @@ curses_message_win_puts(const char *message, boolean recursed) /* bottom of message win */ if (++turn_lines > height || (turn_lines == height && mx > border_space)) { - /* Pause until key is hit - Esc suppresses any further - messages that turn */ - if (curses_more() == '\033') { + /* pause until key is hit - ESC suppresses further messages + this turn unless an urgent message is being delivered */ + if (curses_more() == '\033' + && !curs_mesg_suppress_suppression) { curs_mesg_suppress_turn = g.moves; return; }