diff --git a/src/crafting_gui.cpp b/src/crafting_gui.cpp index 419ab1a56a810..ef22cec5a8bac 100644 --- a/src/crafting_gui.cpp +++ b/src/crafting_gui.cpp @@ -232,7 +232,7 @@ static std::vector recipe_info( recp.batch_savings_string() ); oss << string_format( _( "Activity level: %s\n" ), - activity_level::activity_level_str( recp.exertion_level() ) ); + display::activity_level_str( recp.exertion_level() ) ); const int makes = recp.makes_amount(); if( makes > 1 ) { diff --git a/src/panels.cpp b/src/panels.cpp index 542f01140f5cd..4de99987b0a29 100644 --- a/src/panels.cpp +++ b/src/panels.cpp @@ -1012,7 +1012,7 @@ static std::pair weariness_description( size_t weariness return weary_descriptions[weariness]; } -std::string activity_level::activity_level_str( float level ) +std::string display::activity_level_str( float level ) { static const std::array activity_descriptions { { to_translation( "activity description", "None" ), @@ -1075,7 +1075,7 @@ static void draw_stats( avatar &u, const catacurses::window &w ) mvwprintz( w, point( wlabel_len + 1, 1 ), weary.second, weary.first.translated() ); mvwprintz( w, point( act_start, 1 ), c_light_gray, _( activity_label ) ); mvwprintz( w, point( act_start + alabel_len + 1, 1 ), act_color, - activity_level::activity_level_str( activity ) ); + display::activity_level_str( activity ) ); wnoutrefresh( w ); } @@ -1393,7 +1393,7 @@ static void draw_stat_narrow( avatar &u, const catacurses::window &w ) mvwprintz( w, point( wlabel_len + 2, 3 ), weary.second, weary.first.translated() ); mvwprintz( w, point( act_start, 3 ), c_light_gray, _( activity_label ) ); mvwprintz( w, point( act_start + alabel_len + 1, 3 ), act_color, - activity_level::activity_level_str( activity ) ); + display::activity_level_str( activity ) ); wnoutrefresh( w ); } @@ -1444,7 +1444,7 @@ static void draw_stat_wide( avatar &u, const catacurses::window &w ) mvwprintz( w, point( wlabel_len + 2, 2 ), weary.second, weary.first.translated() ); mvwprintz( w, point( act_start, 2 ), c_light_gray, _( activity_label ) ); mvwprintz( w, point( act_start + alabel_len + 1, 2 ), act_color, - activity_level::activity_level_str( activity ) ); + display::activity_level_str( activity ) ); wnoutrefresh( w ); } @@ -2242,7 +2242,7 @@ static void draw_weariness_classic( const avatar &u, const catacurses::window &w mvwprintz( w, point( wlabel_len + 1, 0 ), weary.second, weary.first.translated() ); mvwprintz( w, point( act_start, 0 ), c_light_gray, _( activity_label ) ); mvwprintz( w, point( act_start + alabel_len + 1, 0 ), act_color, - activity_level::activity_level_str( activity ) ); + display::activity_level_str( activity ) ); std::pair bar = u.weariness_transition_progress(); std::pair weary_bar = get_hp_bar( bar.first, bar.second ); diff --git a/src/panels.h b/src/panels.h index 06769cf97d514..d21aef5a6a1e7 100644 --- a/src/panels.h +++ b/src/panels.h @@ -16,10 +16,13 @@ class JsonOut; class avatar; struct point; -namespace activity_level +// The display namespace contains UI string output and colorization functions +// Some return plain strings or translations, some return a (string, color) pair, +// and some return a string with colorization tags embedded. +namespace display { std::string activity_level_str( float level ); -} // namespace activity_level +} // namespace display namespace catacurses {