'urgent' messages
Follow up on some old groundwork. For tty, if the core has designated
a message as 'urgent', override any message suppression taking place
because of ESC typed at the --More-- prompt. Right now, "You die"
messages, feedback about having something stolen, feedback for
"amorous demon" interaction (mainly in case of armor removal), and
exploding a bag of holding are treated as urgent.
The "You die" case is already handled by a hack in top-line handling;
I left that in place so the conversion of 3 or 4 pline("You die.*")
to custompline(URGENT_MESSAGE, "You die.*") was redundant. There
are probably various non-You_die messages which precede done() which
should be marked urgent too.
Other interfaces might want to do something similar. And we ought to
implement MSGTYPE=force or MSGTYPE=urgent to allow players to indicate
other messages that they want have to override suppression. But I'm
not intending to work on either of those. I mainly wanted to force
the magic bag explosion message to be shown since a sequence of "You
put <foo> into <bag>." messages is a likely candidate for --More--ESC.
This commit is contained in:
+3
-2
@@ -582,8 +582,9 @@ msghistory_snapshot(boolean purge) /* clear message history buffer
|
||||
|
||||
/* release memory allocated to message history snapshot */
|
||||
static void
|
||||
free_msghistory_snapshot(boolean purged) /* True: took history's pointers,
|
||||
False: just cloned them */
|
||||
free_msghistory_snapshot(
|
||||
boolean purged) /* True: took history's pointers,
|
||||
* False: just cloned them */
|
||||
{
|
||||
if (snapshot_mesgs) {
|
||||
/* snapshot pointers are no longer in use */
|
||||
|
||||
+9
-3
@@ -109,9 +109,9 @@ struct window_procs tty_procs = {
|
||||
| WC2_HILITE_STATUS | WC2_HITPOINTBAR | WC2_FLUSH_STATUS
|
||||
| WC2_RESET_STATUS
|
||||
#endif
|
||||
| WC2_DARKGRAY | WC2_SUPPRESS_HIST | WC2_STATUSLINES),
|
||||
| WC2_DARKGRAY | WC2_SUPPRESS_HIST | WC2_URGENT_MESG | WC2_STATUSLINES),
|
||||
#ifdef TEXTCOLOR
|
||||
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
|
||||
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
|
||||
#else
|
||||
{1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1},
|
||||
#endif
|
||||
@@ -2662,7 +2662,13 @@ tty_putstr(winid window, int attr, const char *str)
|
||||
|
||||
switch (cw->type) {
|
||||
case NHW_MESSAGE: {
|
||||
int suppress_history = (attr & ATR_NOHISTORY);
|
||||
int suppress_history = (attr & ATR_NOHISTORY),
|
||||
urgent_message = (attr & ATR_URGENT);
|
||||
|
||||
/* if message is designated 'urgent' don't suppress it if user has
|
||||
typed ESC at --More-- prompt when dismissing an earlier message */
|
||||
if (urgent_message)
|
||||
cw->flags &= ~WIN_STOP;
|
||||
|
||||
/* in case we ever support display attributes for topline
|
||||
messages, clear flag mask leaving only display attr */
|
||||
|
||||
Reference in New Issue
Block a user