Skip to content

Commit

Permalink
Merge branch 'CleverRaven:master' into cnk
Browse files Browse the repository at this point in the history
  • Loading branch information
SurFlurer authored Mar 3, 2023
2 parents 7acdf05 + 1eb525f commit 2526783
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/iexamine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3617,8 +3617,8 @@ void iexamine::keg( Character &you, const tripoint &examp )
{
none( you, examp );
map &here = get_map();
const auto keg_name = here.name( examp );
units::volume keg_cap = get_keg_capacity( examp );
const std::string keg_name = here.name( examp );
const units::volume keg_cap = get_keg_capacity( examp );

const bool has_container_with_liquid = map_cursor( examp ).has_item_with( []( const item & it ) {
return !it.is_container_empty() && it.can_unload_liquid();
Expand Down Expand Up @@ -3711,17 +3711,17 @@ void iexamine::keg( Character &you, const tripoint &examp )
DISPENSE,
HAVE_A_DRINK,
REFILL,
EXAMINE,
};
uilist selectmenu;
//~ $1 - furniture name, $2 - liquid name, $3 - liquid charges, $4 - liquid volume, $5 - liquid capacity
selectmenu.text = string_format( _( "%1$s with %2$s (%3$d) %4$s / %5$s" ),
uppercase_first_letter( keg_name ), drink_tname, drink.charges,
vol_to_string( drink.volume(), true, true ), vol_to_string( keg_cap, true, true ) );
selectmenu.addentry( DISPENSE, drink.made_of( phase_id::LIQUID ), MENU_AUTOASSIGN,
_( "Dispense or dump %s" ), drink_tname );
selectmenu.addentry( HAVE_A_DRINK, drink.is_food() && drink.made_of( phase_id::LIQUID ),
MENU_AUTOASSIGN, _( "Have a drink" ) );
selectmenu.addentry( REFILL, true, MENU_AUTOASSIGN, _( "Refill" ) );
selectmenu.addentry( EXAMINE, true, MENU_AUTOASSIGN, _( "Examine" ) );

selectmenu.text = _( "Select an action" );
selectmenu.query();

switch( selectmenu.ret ) {
Expand Down Expand Up @@ -3764,12 +3764,6 @@ void iexamine::keg( Character &you, const tripoint &examp )
return;
}

case EXAMINE: {
add_msg( m_info, _( "It contains %s (%d), %0.f%% full." ),
drink_tname, drink.charges, drink.volume() * 100.0 / keg_cap );
return;
}

default:
return;
}
Expand Down

0 comments on commit 2526783

Please sign in to comment.