Skip to content

Commit

Permalink
fix(UI): do not hide skills from books on max skill (#4364)
Browse files Browse the repository at this point in the history
fix(UI): show skills on max skill
  • Loading branch information
scarf005 authored Mar 18, 2024
1 parent e49d4a0 commit 23940f4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/game_inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,10 +966,6 @@ class read_inventory_preset final: public inventory_selector_preset
}

const SkillLevel &skill = p.get_skill_level_object( book.skill );
if( !skill.can_train() ) {
return std::string();
}

if( skill.level() < book.req ) {
//~ %1$s: book skill name, %3$d: book required skill level, %3$d: book skill level, %4$d: player skill level
return string_format( pgettext( "skill", "%1$s from %2$d to %3$d (%4$d)" ), book.skill->name(),
Expand All @@ -978,8 +974,10 @@ class read_inventory_preset final: public inventory_selector_preset
}

//~ %1$s: book skill name, %2$d: book skill level, %3$d: player skill level
return string_format( pgettext( "skill", "%1$s to %2$d (%3$d)" ), book.skill->name(), book.level,
skill.level() );
const auto result = string_format( pgettext( "skill", "%1$s to %2$d (%3$d)" ),
book.skill->name(), book.level, skill.level() );

return skill.can_train() ? result : colorize( result, c_brown );
}, _( "TRAINS (CURRENT)" ), unknown );

append_cell( [ this ]( const item * loc ) -> std::string {
Expand Down

0 comments on commit 23940f4

Please sign in to comment.