E char FDECL(genl_message_menu, (CHAR_P,int,const char *));
E void FDECL(genl_preference_update, (const char *));
E char *FDECL(genl_getmsghistory, (BOOLEAN_P));
-E void FDECL(genl_putmsghistory, (const char *));
+E void FDECL(genl_putmsghistory, (const char *,BOOLEAN_P));
#ifdef HANGUPHANDLING
E void NDECL(nhwindows_hangup);
#endif
void FDECL((*win_outrip), (winid,int));
void FDECL((*win_preference_update), (const char *));
char * FDECL((*win_getmsghistory), (BOOLEAN_P));
- void FDECL((*win_putmsghistory), (const char *));
+ void FDECL((*win_putmsghistory), (const char *,BOOLEAN_P));
#ifdef STATUS_VIA_WINDOWPORT
void NDECL((*win_status_init));
void NDECL((*win_status_finish));
E void FDECL(genl_outrip, (winid,int));
E char *FDECL(tty_getmsghistory, (BOOLEAN_P));
-E void FDECL(tty_putmsghistory, (const char *));
+E void FDECL(tty_putmsghistory, (const char *,BOOLEAN_P));
#ifdef NO_TERMS
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
/*ARGSUSED*/
void
-genl_putmsghistory(msg)
+genl_putmsghistory(msg, restoring)
const char *msg;
+boolean restoring;
{
/* window ports can provide
their own putmsghistory() routine to
so it should keep all pointers/indexes
intact at the end of each call.
*/
+#if 0 /* maybe... */
+ if (!restoring) pline("%s", msg);
+#endif
return;
}
Strcpy(outbuf, "\033");
}
-/*ARGUSED*/
+/*ARGSUSED*/
static void
hup_init_nhwindows(argc_p, argv)
int *argc_p;
iflags.window_inited = 1;
}
-/*ARGSUSED*/
+/*ARGUSED*/
static winid
hup_create_nhwindow(type)
int type;
* Called with a null pointer to finish up.
*/
void
-tty_putmsghistory(msg)
+tty_putmsghistory(msg, restoring)
const char *msg;
+boolean restoring;
{
static boolean initd = FALSE;
int idx;
- if (!initd) {
+ if (restoring && !initd) {
/* we're restoring history from the previous session, but new
messages have already been issued this session ("Restoring...",
for instance); collect current history (ie, those new messages),
}
}
-void mswin_putmsghistory(const char * msg)
+void mswin_putmsghistory(const char * msg, BOOLEAN_P restoring)
{
- BOOL save_sound_opt = GetNHApp()->bNoSounds;
+ BOOL save_sound_opt;
+
+ if (!msg) return; /* end of message history restore */
+ save_sound_opt = GetNHApp()->bNoSounds;
GetNHApp()->bNoSounds = TRUE; /* disable sounds while restoring message history */
mswin_putstr_ex(WIN_MESSAGE, ATR_NONE, msg, 0);
clear_nhwindow(WIN_MESSAGE); /* it is in fact end-of-turn indication so each message will print on the new line */
void mswin_outrip(winid wid, int how);
void mswin_preference_update(const char *pref);
char *mswin_getmsghistory(BOOLEAN_P init);
-void mswin_putmsghistory(const char * msg);
+void mswin_putmsghistory(const char * msg,BOOLEAN_P);
/* helper function */
HWND mswin_hwnd_from_winid(winid wid);