follow-up, program_state

This commit is contained in:
nhmall
2024-07-13 16:31:35 -04:00
parent 72d2b0414c
commit 0eb7f109e0
67 changed files with 255 additions and 252 deletions

View File

@@ -1015,7 +1015,7 @@ bool NetHackQtMainWindow::ok_for_command()
* FIXME: it would be much better to gray-out inapplicable entries
* when popping up a command menu instead of needing this.
*/
if (::svp.program_state.input_state != commandInp) {
if (::program_state.input_state != commandInp) {
NetHackQtBind::qt_nhbell();
// possibly call doKeys("\033"); here?
return false;
@@ -1059,7 +1059,7 @@ void NetHackQtMainWindow::doQuit(bool)
// in case someone wants to change that
#ifdef MACOS
QString info = nh_qsprintf("This will end your NetHack session.%s",
!svp.program_state.something_worth_saving ? ""
!program_state.something_worth_saving ? ""
: "\n(Cancel quitting and use the Save command"
"\nto save your current game.)");
/* this is similar to closeEvent but the details are different;
@@ -1077,7 +1077,7 @@ void NetHackQtMainWindow::doQuit(bool)
break; // return to game
case 1:
// quit -- bypass the prompting preformed by done2()
svp.program_state.stopprint++;
program_state.stopprint++;
::done(QUIT);
/*NOTREACHED*/
break;
@@ -1406,7 +1406,7 @@ void NetHackQtMainWindow::keyPressEvent(QKeyEvent* event)
void NetHackQtMainWindow::closeEvent(QCloseEvent *e UNUSED)
{
int ok = 0;
if ( svp.program_state.something_worth_saving ) {
if ( program_state.something_worth_saving ) {
/* this used to offer "Save" and "Cancel"
but cancel (ignoring the close attempt) won't work
if user has clicked on the window's Close button */
@@ -1421,7 +1421,7 @@ void NetHackQtMainWindow::closeEvent(QCloseEvent *e UNUSED)
case 1:
// quit -- bypass the prompting preformed by done2()
ok = 1;
svp.program_state.stopprint++;
program_state.stopprint++;
::done(QUIT);
/*NOTREACHED*/
break;