From 34741931207e1a705d010319aab3618f75a5ae40 Mon Sep 17 00:00:00 2001 From: RenechCDDA <84619419+RenechCDDA@users.noreply.github.com> Date: Fri, 27 Dec 2024 09:59:12 -0500 Subject: [PATCH] Even more sigint-related fixes --- src/input_popup.cpp | 3 ++- src/newcharacter.cpp | 3 ++- src/options.cpp | 2 +- src/string_input_popup.cpp | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/input_popup.cpp b/src/input_popup.cpp index 8bfcfbfedf65d..31158273e2b03 100644 --- a/src/input_popup.cpp +++ b/src/input_popup.cpp @@ -1,6 +1,7 @@ #include "input_popup.h" #include "cata_utility.h" +#include "game.h" #include "imgui/imgui.h" #include "imgui/imgui_internal.h" #include "imgui/imgui_stdlib.h" @@ -385,7 +386,7 @@ T number_input_popup::query() if( action == "TEXT.CONFIRM" ) { return value; - } else if( action == "TEXT.QUIT" ) { + } else if( are_we_quitting() || action == "TEXT.QUIT" ) { break; } diff --git a/src/newcharacter.cpp b/src/newcharacter.cpp index 3b0f937542d06..daf799e13a2c6 100644 --- a/src/newcharacter.cpp +++ b/src/newcharacter.cpp @@ -29,6 +29,7 @@ #include "color.h" #include "cursesdef.h" #include "enum_conversions.h" +#include "game.h" #include "game_constants.h" #include "input_context.h" #include "inventory.h" @@ -160,7 +161,7 @@ void tab_manager::draw( const catacurses::window &w ) bool tab_manager::handle_input( const std::string &action, const input_context &ctxt ) { - if( action == "QUIT" && query_yn( _( "Return to main menu?" ) ) ) { + if( are_we_quitting() || ( action == "QUIT" && query_yn( _( "Return to main menu?" ) ) ) ) { quit = true; } else if( action == "PREV_TAB" ) { position.prev(); diff --git a/src/options.cpp b/src/options.cpp index 012932f23050b..c33f20e6c5e41 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -3913,7 +3913,7 @@ std::string options_manager::show( bool ingame, const bool world_options_only, b default: cata_fatal( "invalid ItemType" ); } - } else if( action == "QUIT" ) { + } else if( are_we_quitting() || action == "QUIT" ) { break; } } diff --git a/src/string_input_popup.cpp b/src/string_input_popup.cpp index d8143b8db5340..e293836e2dc80 100644 --- a/src/string_input_popup.cpp +++ b/src/string_input_popup.cpp @@ -4,6 +4,7 @@ #include "cata_scope_helpers.h" #include "catacharset.h" +#include "game.h" #include "input.h" #include "input_context.h" #include "output.h" @@ -461,7 +462,7 @@ const std::string &string_input_popup::query_string( const bool loop, const bool if( desc_view_ptr && desc_view_ptr->handle_navigation( action, *ctxt ) ) { // NO FURTHER ACTION REQUIRED - } else if( action == "TEXT.QUIT" ) { + } else if( are_we_quitting() || action == "TEXT.QUIT" ) { #if defined(__ANDROID__) if( get_option( "ANDROID_AUTO_KEYBOARD" ) ) { StopTextInput();