Skip to content

Commit

Permalink
astyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Kilvoctu committed May 7, 2020
1 parent b72c238 commit e633595
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions src/ranged.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> t_aims( 4 ), t_confidence( 16 );
int aim_iter = 0, conf_iter = 0;
Expand Down Expand Up @@ -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 = _( "<color_green>Great</color> - <color_light_gray>Normal</color>"
" - <color_magenta>Graze</color> - <color_light_blue>Moves</color>" );
fold_and_print( w, point( 1, line_number++ ), window_width + bars_pad,
Expand All @@ -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 );
Expand Down Expand Up @@ -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( "<color_dark_gray>%s:</color>", label );
t_confidence[( aim_iter * 4 ) + 3] = string_format( "<color_light_blue>%d</color>", 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( _( "<color_white>[%s]</color> %s %s: Moves to fire: "
Expand All @@ -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<int>( 100, 100.0 * ( cr.aim_level ) * confidence ) - last_chance;
Expand All @@ -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<int>( 100, 100.0 * ( config.aim_level * confidence ) ) - last_chance;
last_chance += chance;
return string_format( "%s: <color_%s>%3d%%</color>", 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<int>( 100, 100.0 * ( config.aim_level * confidence ) ) - last_chance;
last_chance += chance;
return string_format( "%s: <color_%s>%3d%%</color>", 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<std::tuple<double, char, std::string>> confidence_ratings;
std::transform( confidence_config.begin(), confidence_config.end(),
Expand Down

0 comments on commit e633595

Please sign in to comment.