From 25470d8989c9e24fb658df188dd573ce3220ede7 Mon Sep 17 00:00:00 2001 From: eso Date: Thu, 5 Dec 2019 15:43:01 -0800 Subject: [PATCH 1/2] add sound/deafness to labels and labels-narrow sidebar layouts --- src/panels.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/panels.cpp b/src/panels.cpp index 267f2c446b87a..ae08feb35f9bd 100644 --- a/src/panels.cpp +++ b/src/panels.cpp @@ -1462,6 +1462,24 @@ 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 ); + 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 ); } @@ -2026,6 +2044,7 @@ static std::vector 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 ) ); From d5f7f0594937e9c15e54027ecae46164b16bb2bd Mon Sep 17 00:00:00 2001 From: eso Date: Thu, 5 Dec 2019 17:13:52 -0800 Subject: [PATCH 2/2] attempt to appease clang-tidy --- src/panels.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/panels.cpp b/src/panels.cpp index ae08feb35f9bd..1da92b89d42ea 100644 --- a/src/panels.cpp +++ b/src/panels.cpp @@ -1474,6 +1474,7 @@ static void draw_needs_labels( const avatar &u, const catacurses::window &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 ) );