Skip to content

Commit

Permalink
Interface: Truncate player display proficiency name (#44728)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pupsi-Mupsi authored Oct 9, 2020
1 parent 1d38f5d commit 068f077
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/player_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,10 @@ static void draw_proficiencies_tab( const catacurses::window &win, const unsigne
if( !cur.known && cur.id->can_learn() ) {
static_assert( grid_width == 26, "Reminder to update formatting"
"for this string when grid width changes" );
name = string_format( "%-22s%2.0f%%", cur.id->name(), cur.practice * 100 );
name = string_format( "%-22s%2.0f%%", trim_by_length( cur.id->name(), width - 2 ),
cur.practice * 100 );
} else {
name = cur.id->name();
name = trim_by_length( cur.id->name(), width );
}
const nc_color col = focused && i == line ? hilite( cur.color ) : cur.color;
y += fold_and_print( win, point( 0, y ), width, col, name );
Expand Down

0 comments on commit 068f077

Please sign in to comment.