Skip to content

Commit

Permalink
fix(UI): more improvements to visibility of bionic scanning (#3977)
Browse files Browse the repository at this point in the history
fix: more improvements to visibility of bionic scanning
  • Loading branch information
chaosvolt authored Dec 25, 2023
1 parent 8870a9e commit 278b433
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8146,7 +8146,10 @@ static void add_corpses( uilist &menu, const std::vector<item *> &its,
int hotkey = get_initial_hotkey( menu_index );

for( const item * const &it : its ) {
menu.addentry( menu_index++, true, hotkey, it->get_mtype()->nname() );
const std::string msg_name = it->has_flag( flag_CBM_SCANNED )
? string_format( _( "%s (bionic detected)" ), it->get_mtype()->nname() )
: _( it->get_mtype()->nname() );
menu.addentry( menu_index++, true, hotkey, msg_name );
hotkey = -1;
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4628,8 +4628,12 @@ std::string item::tname( unsigned int quantity, bool with_prefix, unsigned int t
tagtext += _( " (unread)" );
}
}
if( has_var( "bionics_scanned_by" ) && has_flag( flag_CBM_SCANNED ) ) {
tagtext += _( " (bionic detected)" );
if( has_var( "bionics_scanned_by" ) ) {
if( has_flag( flag_CBM_SCANNED ) ) {
tagtext += _( " (bionic detected)" );
} else {
tagtext += _( " (scanned)" );
}
}
if( has_flag( flag_ETHEREAL_ITEM ) ) {
tagtext += string_format( _( " (%s turns)" ), get_var( "ethereal" ) );
Expand Down

0 comments on commit 278b433

Please sign in to comment.