Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicate item name in info window #38610

Merged
merged 2 commits into from
Mar 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,9 @@ input_event draw_item_info( const catacurses::window &win, item_info_data &data
if( !data.get_item_name().empty() ) {
buffer += data.get_item_name() + "\n";
}
if( data.get_item_name() != data.get_type_name() && !data.get_type_name().empty() ) {
// If type name is set, and not already contained in item name, output it too
if( !data.get_type_name().empty() &&
data.get_item_name().find( data.get_type_name() ) == std::string::npos ) {
buffer += data.get_type_name() + "\n";
}
for( unsigned int i = 0; i < data.padding; i++ ) {
Expand Down