Merge branch 'NetHack-3.6.2'
This commit is contained in:
+20
-4
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 topl.c $NHDT-Date: 1540934784 2018/10/30 21:26:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.38 $ */
|
||||
/* NetHack 3.6 topl.c $NHDT-Date: 1549327499 2019/02/05 00:44:59 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.43 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2009. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
STATIC_DCL void FDECL(redotoplin, (const char *));
|
||||
STATIC_DCL void FDECL(topl_putsym, (CHAR_P));
|
||||
STATIC_DCL void NDECL(remember_topl);
|
||||
STATIC_DCL void FDECL(removetopl, (int));
|
||||
STATIC_DCL void FDECL(msghistory_snapshot, (BOOLEAN_P));
|
||||
STATIC_DCL void FDECL(free_msghistory_snapshot, (BOOLEAN_P));
|
||||
@@ -144,7 +143,23 @@ const char *str;
|
||||
more();
|
||||
}
|
||||
|
||||
STATIC_OVL void
|
||||
/* for use by tty_putstr() */
|
||||
void
|
||||
show_topl(str)
|
||||
const char *str;
|
||||
{
|
||||
struct WinDesc *cw = wins[WIN_MESSAGE];
|
||||
|
||||
if (!(cw->flags & WIN_STOP)) {
|
||||
cw->curx = cw->cury = 0;
|
||||
home();
|
||||
cl_end();
|
||||
addtopl(str);
|
||||
}
|
||||
}
|
||||
|
||||
/* used by update_topl(); also by tty_putstr() */
|
||||
void
|
||||
remember_topl()
|
||||
{
|
||||
register struct WinDesc *cw = wins[WIN_MESSAGE];
|
||||
@@ -231,7 +246,8 @@ register const char *bp;
|
||||
/* If there is room on the line, print message on same line */
|
||||
/* But messages like "You die..." deserve their own line */
|
||||
n0 = strlen(bp);
|
||||
if ((ttyDisplay->toplin == 1 || (cw->flags & WIN_STOP)) && cw->cury == 0
|
||||
if ((ttyDisplay->toplin == 1 || (cw->flags & WIN_STOP))
|
||||
&& cw->cury == 0
|
||||
&& n0 + (int) strlen(g.toplines) + 3 < CO - 8 /* room for --More-- */
|
||||
&& (notdied = strncmp(bp, "You die", 7)) != 0) {
|
||||
Strcat(g.toplines, " ");
|
||||
|
||||
+20
-4
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 wintty.c $NHDT-Date: 1545705819 2018/12/25 02:43:39 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.190 $ */
|
||||
/* NetHack 3.6 wintty.c $NHDT-Date: 1549327503 2019/02/05 00:45:03 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.193 $ */
|
||||
/* Copyright (c) David Cohrs, 1991 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -94,7 +94,7 @@ struct window_procs tty_procs = {
|
||||
| WC2_HILITE_STATUS | WC2_HITPOINTBAR | WC2_FLUSH_STATUS
|
||||
| WC2_RESET_STATUS
|
||||
#endif
|
||||
| WC2_DARKGRAY),
|
||||
| WC2_DARKGRAY | WC2_SUPPRESS_HIST),
|
||||
tty_init_nhwindows, tty_player_selection, tty_askname, tty_get_nh_event,
|
||||
tty_exit_nhwindows, tty_suspend_nhwindows, tty_resume_nhwindows,
|
||||
tty_create_nhwindow, tty_clear_nhwindow, tty_display_nhwindow,
|
||||
@@ -2572,13 +2572,29 @@ const char *str;
|
||||
print_vt_code2(AVTC_SELECT_WINDOW, window);
|
||||
|
||||
switch (cw->type) {
|
||||
case NHW_MESSAGE:
|
||||
case NHW_MESSAGE: {
|
||||
int suppress_history = (attr & ATR_NOHISTORY);
|
||||
|
||||
/* in case we ever support display attributes for topline
|
||||
messages, clear flag mask leaving only display attr */
|
||||
/*attr &= ~(ATR_URGENT | ATR_NOHISTORY);*/
|
||||
|
||||
/* really do this later */
|
||||
#if defined(USER_SOUNDS) && defined(WIN32CON)
|
||||
play_sound_for_message(str);
|
||||
#endif
|
||||
update_topl(str);
|
||||
if (!suppress_history) {
|
||||
/* normal output; add to current top line if room, else flush
|
||||
whatever is there to history and then write this */
|
||||
update_topl(str);
|
||||
} else {
|
||||
/* put anything already on top line into history */
|
||||
remember_topl();
|
||||
/* write to top line without remembering what we're writing */
|
||||
show_topl(str);
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifndef STATUS_HILITES
|
||||
case NHW_STATUS:
|
||||
ob = &cw->data[cw->cury][j = cw->curx];
|
||||
|
||||
Reference in New Issue
Block a user