Skip to content

Commit

Permalink
Even more sigint-related fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA committed Dec 27, 2024
1 parent 163ee18 commit 3474193
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/input_popup.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -385,7 +386,7 @@ T number_input_popup<T>::query()

if( action == "TEXT.CONFIRM" ) {
return value;
} else if( action == "TEXT.QUIT" ) {
} else if( are_we_quitting() || action == "TEXT.QUIT" ) {
break;
}

Expand Down
3 changes: 2 additions & 1 deletion src/newcharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/string_input_popup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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<bool>( "ANDROID_AUTO_KEYBOARD" ) ) {
StopTextInput();
Expand Down

0 comments on commit 3474193

Please sign in to comment.