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
+3 -2
View File
@@ -704,13 +704,14 @@ boolean init;
* 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),
+5 -2
View File
@@ -1980,9 +1980,12 @@ char *mswin_getmsghistory(BOOLEAN_P init)
}
}
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 */
+1 -1
View File
@@ -160,7 +160,7 @@ void mswin_end_screen(void);
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);