Skip to content

Commit

Permalink
item: improve hidden marker
Browse files Browse the repository at this point in the history
only show it for container pockets
  • Loading branch information
andrei8l committed Apr 7, 2022
1 parent cfae94f commit d73f56a
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5976,12 +5976,18 @@ std::string item::tname( unsigned int quantity, bool with_prefix, unsigned int t
//~ [container item name] " > [inner item name] (qty)
" > %1$s (%2$zd)" ), contents_tname, contents_count );
}

if( is_collapsed() ) {
contents_suffix_text += string_format( " %s", _( "hidden" ) );
}
}
} else if( !contents.empty() && contents.num_item_stacks() != 0 ) {
contents_suffix_text = string_format( npgettext( "item name",
//~ [container item name] " > [count] item"
" > %1$zd item", " > %1$zd items",
contents.num_item_stacks() ), contents.num_item_stacks() );
std::string const suffix =
npgettext( "item name",
//~ [container item name] " > [count] item"
" > %1$zd%2$sitem", " > %1$zd%2$sitems", contents.num_item_stacks() );
std::string const hidden = string_format( " %s", is_collapsed() ? _( "hidden" ) : "" );
contents_suffix_text = string_format( suffix, contents.num_item_stacks(), hidden );
}

Character &player_character = get_player_character();
Expand Down Expand Up @@ -6300,12 +6306,7 @@ std::string item::display_name( unsigned int quantity ) const
}
}

std::string collapsed;
if( is_collapsed() ) {
collapsed = string_format( " %s", _( "hidden" ) );
}

return string_format( "%s%s%s%s", name, sidetxt, amt, collapsed );
return string_format( "%s%s%s", name, sidetxt, amt );
}

bool item::is_collapsed() const
Expand Down

0 comments on commit d73f56a

Please sign in to comment.