Skip to content

Commit

Permalink
add sound/deafness to labels and labels-narrow sidebar layouts (#35886)
Browse files Browse the repository at this point in the history
* add sound/deafness to labels and labels-narrow sidebar layouts

* attempt to appease clang-tidy
  • Loading branch information
esotericist authored and ZhilkinSerg committed Dec 6, 2019
1 parent d349a0b commit f25ef50
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/panels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,25 @@ static void draw_needs_labels( const avatar &u, const catacurses::window &w )
mvwprintz( w, point( 30, 1 ), hunger_pair.second, hunger_pair.first );
mvwprintz( w, point( 1, 2 ), c_light_gray, _( "Heat :" ) );
mvwprintz( w, point( 8, 2 ), temp_pair.first, temp_pair.second );
mvwprintz( w, point( 23, 2 ), c_light_gray, _( "Sound:" ) );
if( !u.is_deaf() ) {
mvwprintz( w, point( 30, 2 ), c_yellow, to_string( u.volume ) );
} else {
mvwprintz( w, point( 30, 2 ), c_red, _( "Deaf!" ) );
}
wrefresh( w );
}

static void draw_sound_narrow( const avatar &u, const catacurses::window &w )
{
werase( w );
// NOLINTNEXTLINE(cata-use-named-point-constants)
mvwprintz( w, point( 1, 0 ), c_light_gray, _( "Sound:" ) );
if( !u.is_deaf() ) {
mvwprintz( w, point( 8, 0 ), c_yellow, to_string( u.volume ) );
} else {
mvwprintz( w, point( 8, 0 ), c_red, _( "Deaf!" ) );
}
wrefresh( w );
}

Expand Down Expand Up @@ -2026,6 +2045,7 @@ static std::vector<window_panel> initialize_default_label_narrow_panels()
ret.emplace_back( window_panel( draw_wind_padding, translate_marker( "Wind" ), 1, 32, false ) );
ret.emplace_back( window_panel( draw_weapon_labels, translate_marker( "Weapon" ), 2, 32, true ) );
ret.emplace_back( window_panel( draw_needs_narrow, translate_marker( "Needs" ), 5, 32, true ) );
ret.emplace_back( window_panel( draw_sound_narrow, translate_marker( "Sound" ), 1, 32, true ) );
ret.emplace_back( window_panel( draw_messages, translate_marker( "Log" ), -2, 32, true ) );
ret.emplace_back( window_panel( draw_moon_narrow, translate_marker( "Moon" ), 2, 32, false ) );
ret.emplace_back( window_panel( draw_armor_padding, translate_marker( "Armor" ), 5, 32, false ) );
Expand Down

0 comments on commit f25ef50

Please sign in to comment.