int in_self_recover;
int in_parseoptions; /* in parseoptions */
int config_error_ready; /* config_error_add is ready, available */
+ int beyond_savefile_load; /* set when past savefile loading */
#ifdef PANICLOG
int in_paniclog;
#endif
/* per-level glyph mapping flags */
long glyphmap_perlevel_flags;
+ int early_raw_messages; /* if raw_prints occurred early prior
+ to g.beyond_savefile_load */
unsigned long magic; /* validate that structure layout is preserved */
};
/* per-level glyph mapping flags */
0L, /* glyphmap_perlevel_flags */
+ 0, /* early_raw_messages */
IVMAGIC /* used to validate that structure layout has been preserved */
};
va_start(the_args, line);
vraw_printf(line, the_args);
va_end(the_args);
+ if (!g.program_state.beyond_savefile_load)
+ g.early_raw_messages++;
}
DISABLE_WARNING_FORMAT_NONLITERAL
#if defined(MSGHANDLER)
execplinehandler(line);
#endif
+ if (!g.program_state.beyond_savefile_load)
+ g.early_raw_messages++;
}
void
run_timers(); /* expire all timers that have gone off while away */
g.program_state.restoring = 0; /* affects bot() so clear before docrt() */
+
+ if (g.early_raw_messages && !g.program_state.beyond_savefile_load) {
+ /*
+ * We're about to obliterate some potentially important
+ * startup messages, so give the player a chance to see them.
+ */
+ g.early_raw_messages = 0;
+ wait_synch();
+ }
+ g.program_state.beyond_savefile_load = 0;
+
docrt();
clear_nhwindow(WIN_MESSAGE);
iflags.news = FALSE; /* in case dorecover() fails */
}
#endif
- pline("Restoring save file...");
+ /* if there are early trouble-messages issued, let's
+ * not go overtop of them with a pline just yet */
+ if (g.early_raw_messages)
+ raw_print("Restoring save file...");
+ else
+ pline("Restoring save file...");
mark_synch(); /* flush output */
if (dorecover(nhfp)) {
resuming = TRUE; /* not starting new game */
/* this is a candidate for paranoid_confirmation */
c = yn(destroy_old_game_prompt);
} else {
- (void) printf("\n%s [yn] ", destroy_old_game_prompt);
+ (void) raw_printf("\n%s [yn] ", destroy_old_game_prompt);
(void) fflush(stdout);
if ((c = getchar()) != EOF) {
int tmp;
iflags.news = FALSE;
}
#endif
- pline("Restoring save file...");
+ if (g.early_raw_messages)
+ raw_print("Restoring save file...");
+ else
+ pline("Restoring save file...");
mark_synch(); /* flush output */
if (dorecover(nhfp)) {
resuming = TRUE; /* not starting new game */
: "not start a new game");
if (istty)
clear_screen();
- pline(oops);
+ raw_printf("%s", oops);
if (prompt_result == 1) { /* recover */
if (recover_savefile()) {
#if 0
return _getch();
}
+extern int windows_console_custom_nhgetch(void);
void
getreturn(const char *str)
in_getreturn = TRUE;
Sprintf(buf,"Hit <Enter> %s.", str);
raw_print(buf);
+ if (WINDOWPORT("tty"))
+ windows_console_custom_nhgetch();
wait_synch();
in_getreturn = FALSE;
return;
| WC2_HILITE_STATUS | WC2_HITPOINTBAR | WC2_FLUSH_STATUS
| WC2_RESET_STATUS
#endif
- | WC2_DARKGRAY | WC2_SUPPRESS_HIST | WC2_URGENT_MESG | WC2_STATUSLINES)
+ | WC2_DARKGRAY | WC2_SUPPRESS_HIST | WC2_URGENT_MESG | WC2_STATUSLINES
| WC2_U_UTF8STR
#if !defined(NO_TERMS) || defined(WIN32)
| WC2_U_24BITCOLOR
#endif
- ,
+ ),
#ifdef TEXTCOLOR
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
#else
tty_clear_nhwindow(BASE_WINDOW);
- tty_putstr(BASE_WINDOW, 0, "");
+ /* Once pline() is functional, error-related prompts such as
+ * those relating to save files etc. can intrude on the
+ * copyright information display because their prompts are
+ * up at the very top in the message window.
+ * Move the copyright information a little further down to
+ * row 3, out of the way. */
+
+ tty_curs(BASE_WINDOW, 1, 4);
for (i = 1; i <= 4; ++i)
tty_putstr(BASE_WINDOW, 0, copyright_banner_line(i));
tty_putstr(BASE_WINDOW, 0, "");
tty_display_nhwindow(BASE_WINDOW, FALSE);
+ /* Move to a default location for the "Shall I pick .." player
+ * selection prompts, which also use the BASE_WINDOW. Leave
+ * room for as many as 3 unexpected raw_prints early startup
+ * messages above that.
+ * If there is a topline message prompt, before the
+ * "Shall I pick ..." prompt, the latter will end up appearing
+ * immediately after the topline message prompt. There should
+ * now be room. */
+ tty_curs(BASE_WINDOW, 1, 11);
+
/* 'statuslines' defaults to set_in_config, allowed but invisible;
make it dynamically settable if feasible, otherwise visible */
if (tty_procs.wincap2 & WC2_STATUSLINES)