Skip to content

Commit

Permalink
Move option
Browse files Browse the repository at this point in the history
  • Loading branch information
Procyonae committed Dec 6, 2024
1 parent c5d5375 commit 4abbace
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2855,7 +2855,7 @@ bool game::query_exit_to_OS()
const int old_timeout = inp_mngr.get_timeout();
inp_mngr.reset_timeout();
uquit = QUIT_EXIT_PENDING; // change it before query so input_context doesn't get confused
if( !get_option<bool>( "QUERY_ON_QUIT" ) ||
if( !get_option<bool>( "QUERY_QUIT" ) ||
query_yn( _( "Really Quit? All unsaved changes will be lost." ) ) ) {
uquit = QUIT_EXIT;
throw exit_exception();
Expand Down
2 changes: 1 addition & 1 deletion src/handle_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2820,7 +2820,7 @@ bool game::do_regular_action( action_id &act, avatar &player_character,
break;

case ACTION_SAVE:
if( !get_option<bool>( "QUERY_ON_QUIT" ) || query_yn( _( "Save and quit?" ) ) ) {
if( !get_option<bool>( "QUERY_QUIT" ) || query_yn( _( "Save and quit?" ) ) ) {
if( save() ) {
player_character.set_moves( 0 );
uquit = QUIT_SAVED;
Expand Down
2 changes: 1 addition & 1 deletion src/main_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ bool main_menu::opening_screen()
if( action == "QUIT" ) {
#if !defined(EMSCRIPTEN)
g->uquit = QUIT_EXIT_PENDING;
if( !get_option<bool>( "QUERY_ON_QUIT" ) || query_yn( _( "Really quit?" ) ) ) {
if( !get_option<bool>( "QUERY_QUIT" ) || query_yn( _( "Really quit?" ) ) ) {
g->uquit = QUIT_EXIT;
return false;
}
Expand Down
10 changes: 5 additions & 5 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1926,6 +1926,11 @@ void options_manager::add_options_interface()
true
);

add( "QUERY_QUIT", page_id, to_translation( "Query on quit" ),
to_translation( "If true, will query before before quitting the game." ),
true
);

add( "CLOSE_ADV_INV", page_id, to_translation( "Close advanced inventory on move all" ),
to_translation( "If true, will close the advanced inventory when the move all items command is used." ),
false
Expand Down Expand Up @@ -2972,11 +2977,6 @@ void options_manager::add_options_debug()
false
#endif
);

add( "QUERY_ON_QUIT", "debug", to_translation( "Prompt when trying to quit the game" ),
to_translation( "If enabled, this shows a yes/no prompt before quitting the game." ),
true
);
}

void options_manager::add_options_android()
Expand Down

0 comments on commit 4abbace

Please sign in to comment.