diff --git a/src/action.h b/src/action.h index 595d725d824e8..27abf0e7d7120 100644 --- a/src/action.h +++ b/src/action.h @@ -480,7 +480,7 @@ std::optional choose_adjacent_bub( const std::string &message, std::optional choose_adjacent( const tripoint &pos, const std::string &message, bool allow_vertical = false ); std::optional choose_adjacent( const tripoint_bub_ms &pos, - const std::string &message, bool allow_vertical = false, int timeout = -1, + const std::string &message, bool allow_vertical = false, int timeout = 50, const std::function>( const input_context &ctxt, const std::string &action )> &action_cb = nullptr ); @@ -509,7 +509,7 @@ std::optional choose_adjacent( const tripoint_bub_ms &pos, std::optional choose_direction( const std::string &message, bool allow_vertical = false ); std::optional choose_direction_rel_ms( const std::string &message, - bool allow_vertical = false, bool allow_mouse = false, int timeout = -1, + bool allow_vertical = false, bool allow_mouse = false, int timeout = 50, const std::function>( const input_context &ctxt, const std::string &action )> &action_cb = nullptr ); diff --git a/src/do_turn.cpp b/src/do_turn.cpp index a017882f17f2c..744ec116531b9 100644 --- a/src/do_turn.cpp +++ b/src/do_turn.cpp @@ -714,7 +714,9 @@ bool do_turn() // Avoid redrawing the main UI every time due to invalidation ui_adaptor dummy( ui_adaptor::disable_uis_below {} ); - g->wait_popup = std::make_unique(); + if( !g->wait_popup ) { + g->wait_popup = std::make_unique(); + } g->wait_popup->on_top( true ).wait_message( "%s", wait_message ); ui_manager::redraw(); refresh_display(); diff --git a/src/popup.cpp b/src/popup.cpp index a580efe2ddeaa..d7f36aa2f2c21 100644 --- a/src/popup.cpp +++ b/src/popup.cpp @@ -317,16 +317,13 @@ query_popup::result query_popup::query_once() if( cancel ) { ctxt.register_action( "QUIT" ); } -#if defined(WIN32) || defined(TILES) - ctxt.set_timeout( 50 ); -#endif result res; // Assign outside construction of `res` to ensure execution order res.wait_input = !anykey; do { ui_manager::redraw(); - res.action = ctxt.handle_input(); + res.action = ctxt.handle_input( 50 ); res.evt = ctxt.get_raw_input(); // If we're tracking mouse movement