diff --git a/src/main_menu.cpp b/src/main_menu.cpp index b7c68f4f0d144..9b3fd2199a5a4 100644 --- a/src/main_menu.cpp +++ b/src/main_menu.cpp @@ -597,6 +597,7 @@ bool main_menu::opening_screen() // for mouse selection ctxt.register_action( "SELECT" ); + ctxt.register_action( "MOUSE_MOVE" ); // for the menu shortcuts ctxt.register_action( "ANY_INPUT" ); @@ -699,6 +700,34 @@ bool main_menu::opening_screen() } } } + if( action == "SELECT" || action == "MOUSE_MOVE" ) { + cata::optional coord = ctxt.get_coordinates_text( catacurses::stdscr ); + for( const auto &it : main_menu_button_map ) { + if( coord.has_value() && it.first.contains( coord.value() ) ) { + if( sel1 != it.second ) { + sel1 = it.second; + sel2 = sel1 == getopt( main_menu_opts::LOADCHAR ) ? last_world_pos : 0; + } + if( action == "SELECT" && + ( sel1 == getopt( main_menu_opts::HELP ) || sel1 == getopt( main_menu_opts::QUIT ) ) ) { + action = "CONFIRM"; + } + ui_manager::redraw(); + break; + } + } + for( const auto &it : main_menu_sub_button_map ) { + if( coord.has_value() && it.first.contains( coord.value() ) ) { + sel1 = it.second.first; + sel2 = it.second.second; + if( action == "SELECT" ) { + action = "CONFIRM"; + } + ui_manager::redraw(); + break; + } + } + } // also check special keys if( action == "QUIT" ) {