diff --git a/src/ranged.cpp b/src/ranged.cpp index 20f57586f7dae..1c2cc57d1d1ed 100644 --- a/src/ranged.cpp +++ b/src/ranged.cpp @@ -1235,7 +1235,7 @@ static int print_ranged_chance( const player &p, const catacurses::window &w, in if( ( panel_type == "compact" || panel_type == "labels-narrow" ) && display_type != "numbers" ) { window_width -= bars_pad; } - + std::string label_m = _( "Moves" ); std::vector t_aims( 4 ), t_confidence( 16 ); int aim_iter = 0, conf_iter = 0; @@ -1271,7 +1271,7 @@ static int print_ranged_chance( const player &p, const catacurses::window &w, in } line_number++; } - if( ( panel_type == "compact" || panel_type == "labels-narrow" ) && display_type == "numbers" ) { + if( ( panel_type == "compact" || panel_type == "labels-narrow" ) && display_type == "numbers" ) { std::string symbols = _( "Great - Normal" " - Graze - Moves" ); fold_and_print( w, point( 1, line_number++ ), window_width + bars_pad, @@ -1282,8 +1282,8 @@ static int print_ranged_chance( const player &p, const catacurses::window &w, in } for( int i = 0; i < window_width; i++ ) { mvwprintw( w, point( i + 1, line_number ), "-" ); - } - } + } + } const auto front_or = [&]( const std::string & s, const char fallback ) { const auto keys = ctxt.keys_bound_to( s ); @@ -1313,15 +1313,15 @@ static int print_ranged_chance( const player &p, const catacurses::window &w, in auto hotkey = front_or( type.action.empty() ? "FIRE" : type.action, ' ' ); if( ( panel_type == "compact" || panel_type == "labels-narrow" ) ) { - if( display_type == "numbers" ) { + if( display_type == "numbers" ) { t_aims[aim_iter] = string_format( "%s:", label ); t_confidence[( aim_iter * 4 ) + 3] = string_format( "%d", moves_to_fire ); - } else { - print_colored_text( w, point( 1, line_number ), col, col, string_format( _( "%s %s:" ), label, - aim_l ) ); - right_print( w, line_number++, 1, c_light_blue, _( "Moves" ) ); - right_print( w, line_number, 1, c_light_blue, string_format( "%d", moves_to_fire ) ); - } + } else { + print_colored_text( w, point( 1, line_number ), col, col, string_format( _( "%s %s:" ), label, + aim_l ) ); + right_print( w, line_number++, 1, c_light_blue, _( "Moves" ) ); + right_print( w, line_number, 1, c_light_blue, string_format( "%d", moves_to_fire ) ); + } } else { print_colored_text( w, point( 1, line_number++ ), col, col, string_format( _( "[%s] %s %s: Moves to fire: " @@ -1332,7 +1332,7 @@ static int print_ranged_chance( const player &p, const catacurses::window &w, in double confidence = confidence_estimate( range, target_size, current_dispersion ); if( display_type == "numbers" ) { - if( panel_type == "compact" || panel_type == "labels-narrow" ) { + if( panel_type == "compact" || panel_type == "labels-narrow" ) { int last_chance = 0; for( const confidence_rating &cr : confidence_config ) { int chance = std::min( 100, 100.0 * ( cr.aim_level ) * confidence ) - last_chance; @@ -1344,19 +1344,19 @@ static int print_ranged_chance( const player &p, const catacurses::window &w, in } } aim_iter++; - } else { - int last_chance = 0; - std::string confidence_s = enumerate_as_string( confidence_config.begin(), confidence_config.end(), - [&]( const confidence_rating & config ) { - // TODO: Consider not printing 0 chances, but only if you can print something (at least miss 100% or so) - int chance = std::min( 100, 100.0 * ( config.aim_level * confidence ) ) - last_chance; - last_chance += chance; - return string_format( "%s: %3d%%", pgettext( "aim_confidence", - config.label.c_str() ), config.color, chance ); - }, enumeration_conjunction::none ); - line_number += fold_and_print_from( w, point( 1, line_number ), window_width, 0, - c_dark_gray, confidence_s ); - } + } else { + int last_chance = 0; + std::string confidence_s = enumerate_as_string( confidence_config.begin(), confidence_config.end(), + [&]( const confidence_rating & config ) { + // TODO: Consider not printing 0 chances, but only if you can print something (at least miss 100% or so) + int chance = std::min( 100, 100.0 * ( config.aim_level * confidence ) ) - last_chance; + last_chance += chance; + return string_format( "%s: %3d%%", pgettext( "aim_confidence", + config.label.c_str() ), config.color, chance ); + }, enumeration_conjunction::none ); + line_number += fold_and_print_from( w, point( 1, line_number ), window_width, 0, + c_dark_gray, confidence_s ); + } } else { std::vector> confidence_ratings; std::transform( confidence_config.begin(), confidence_config.end(),