tty ^P message recall
Extend 'putstr(WIN_MESSAGE, attribute, string)'s attribute so that
'custompline(SUPPRESS_HISTORY, ...)' can work with ^P's message
history like DUMPLOG history, in order to keep autodescribe feedback
and intermediate prompts for multi-digit count ('Count: 12', 'Count:
123') prompts out of recall history. The old autodescribe behavior
could easily push all real messages out of the recall buffer when
moving the cursor around for getpos, and the count behavior looked
silly for a four or five digit gold count if you set the msg_window
option to 'full' or 'combination' and viewed them all at once.
Other interfaces may want to follow suit, but this doesn't force them
to make any changes. I added a hook for "urgent messages" that might
be rendered in bold or red or some such and/or override the use of
ESC at --More-- from suppressing further messages, but there aren't
any custompline(URGENT_MESSAGE, ...) calls (potentially "You die...",
for instance) to exercise it. Other people have implemented similar
feature it different ways and I'm not sure whether this one is really
the way to go since the core needs to categorize each message that it
deems to be urgent. MSG_TYPE:stop may be sufficent, although MSG_TYPE
matching can entail a lot of regexp execution overhead at run-time.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 hack.h $NHDT-Date: 1547514631 2019/01/15 01:10:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.101 $ */
|
||||
/* NetHack 3.6 hack.h $NHDT-Date: 1549327459 2019/02/05 00:44:19 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.102 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Pasi Kallinen, 2017. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -402,6 +402,7 @@ enum explosion_types {
|
||||
#define PLINE_NOREPEAT 1
|
||||
#define OVERRIDE_MSGTYPE 2
|
||||
#define SUPPRESS_HISTORY 4
|
||||
#define URGENT_MESSAGE 8
|
||||
|
||||
/* Macros for messages referring to hands, eyes, feet, etc... */
|
||||
enum bodypart_types {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 winprocs.h $NHDT-Date: 1502141230 2017/08/07 21:27:10 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.38 $ */
|
||||
/* NetHack 3.6 winprocs.h $NHDT-Date: 1549327479 2019/02/05 00:44:39 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.46 $ */
|
||||
/* Copyright (c) David Cohrs, 1992 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -213,14 +213,20 @@ extern
|
||||
#define WC2_DARKGRAY 0x0020L /* 06 use bold black for black glyphs */
|
||||
#define WC2_HITPOINTBAR 0x0040L /* 07 show bar representing hit points */
|
||||
#define WC2_FLUSH_STATUS 0x0080L /* 08 call status_update(BL_FLUSH)
|
||||
after updating status window fields */
|
||||
#define WC2_RESET_STATUS 0x0100L /* 09 call status_update(BL_RESET) to indicate
|
||||
draw everything */
|
||||
* after updating status window fields */
|
||||
#define WC2_RESET_STATUS 0x0100L /* 09 call status_update(BL_RESET) to
|
||||
* indicate 'draw everything' */
|
||||
#define WC2_TERM_SIZE 0x0200L /* 10 support setting terminal size */
|
||||
#define WC2_WINDOWBORDERS 0x0400L /* 11 display borders on nh windows */
|
||||
#define WC2_PETATTR 0x0800L /* 12 attributes for hilite_pet */
|
||||
#define WC2_GUICOLOR 0x1000L /* 13 display colours outside map win */
|
||||
/* 19 free bits */
|
||||
/* pline() can overload the display attributes argument passed to putstr()
|
||||
with one or more flags and at most one of bold/blink/inverse/&c */
|
||||
#define WC2_URGENT_MESG 0x2000L /* 14 putstr(WIN_MESSAGE) supports urgency
|
||||
* via non-display attribute flag */
|
||||
#define WC2_SUPPRESS_HIST 0x4000L /* 15 putstr(WIN_MESSAGE) supports history
|
||||
* suppression via non-disp attr */
|
||||
/* 17 free bits */
|
||||
|
||||
#define ALIGN_LEFT 1
|
||||
#define ALIGN_RIGHT 2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 wintty.h $NHDT-Date: 1433806583 2015/06/08 23:36:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */
|
||||
/* NetHack 3.6 wintty.h $NHDT-Date: 1549327485 2019/02/05 00:44:45 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.32 $ */
|
||||
/* Copyright (c) David Cohrs, 1991,1992 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -164,6 +164,8 @@ E int FDECL(has_color, (int color));
|
||||
|
||||
/* ### topl.c ### */
|
||||
|
||||
E void FDECL(show_topl, (const char *));
|
||||
E void NDECL(remember_topl);
|
||||
E void FDECL(addtopl, (const char *));
|
||||
E void NDECL(more);
|
||||
E void FDECL(update_topl, (const char *));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 wintype.h $NHDT-Date: 1461028538 2016/04/19 01:15:38 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.16 $ */
|
||||
/* NetHack 3.6 wintype.h $NHDT-Date: 1549327486 2019/02/05 00:44:46 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.19 $ */
|
||||
/* Copyright (c) David Cohrs, 1991 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -74,12 +74,16 @@ typedef struct mi {
|
||||
#define NHW_TEXT 5
|
||||
|
||||
/* attribute types for putstr; the same as the ANSI value, for convenience */
|
||||
#define ATR_NONE 0
|
||||
#define ATR_BOLD 1
|
||||
#define ATR_DIM 2
|
||||
#define ATR_ULINE 4
|
||||
#define ATR_BLINK 5
|
||||
#define ATR_INVERSE 7
|
||||
#define ATR_NONE 0
|
||||
#define ATR_BOLD 1
|
||||
#define ATR_DIM 2
|
||||
#define ATR_ULINE 4
|
||||
#define ATR_BLINK 5
|
||||
#define ATR_INVERSE 7
|
||||
/* not a display attribute but passed to putstr() as an attribute;
|
||||
can be masked with one regular display attribute */
|
||||
#define ATR_URGENT 16
|
||||
#define ATR_NOHISTORY 32
|
||||
|
||||
/* nh_poskey() modifier types */
|
||||
#define CLICK_1 1
|
||||
|
||||
Reference in New Issue
Block a user