putmsghistory() (trunk only)

[Third of three message history patches.]

     Add another argument to putmsghistory() so that it can tell whether
it's processing multiple messages for restore (which should be treated as
being older than any current messages) or a single message to stuff into
history (which should be treated as the most recent message even though
it hasn't been displayed in the message window).
This commit is contained in:
nethack.rankin
2009-04-06 01:43:01 +00:00
parent 47dad80337
commit f468865494
8 changed files with 21 additions and 13 deletions

View File

@@ -1152,10 +1152,10 @@ register int fd;
panic("restore_msghistory: msg too big (%d)", msgsize);
mread(fd, (genericptr_t)msg, msgsize);
msg[msgsize] = '\0';
putmsghistory(msg);
putmsghistory(msg, TRUE);
++msgcount;
}
if (msgcount) putmsghistory((char *)0);
if (msgcount) putmsghistory((char *)0, TRUE);
#ifdef DEBUG_MSGCOUNT
pline("Read %d messages from savefile.", msgcount);
#endif

View File

@@ -177,8 +177,9 @@ boolean init;
/*ARGSUSED*/
void
genl_putmsghistory(msg)
genl_putmsghistory(msg, restoring)
const char *msg;
boolean restoring;
{
/* window ports can provide
their own putmsghistory() routine to
@@ -197,6 +198,9 @@ const char *msg;
so it should keep all pointers/indexes
intact at the end of each call.
*/
#if 0 /* maybe... */
if (!restoring) pline("%s", msg);
#endif
return;
}
@@ -387,7 +391,7 @@ char *outbuf;
Strcpy(outbuf, "\033");
}
/*ARGUSED*/
/*ARGSUSED*/
static void
hup_init_nhwindows(argc_p, argv)
int *argc_p;
@@ -396,7 +400,7 @@ char **argv;
iflags.window_inited = 1;
}
/*ARGSUSED*/
/*ARGUSED*/
static winid
hup_create_nhwindow(type)
int type;