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

More obvious hint before going to sleep (UPDATED) #38722

Merged
merged 10 commits into from
Mar 14, 2020
20 changes: 10 additions & 10 deletions src/handle_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,23 +901,23 @@ static void sleep()
return;
}
uilist as_m;
as_m.text = _( "Are you sure you want to sleep?" );
as_m.text = _( "<color_white>Are you sure you want to sleep?</color>" );
// (Y)es/(S)ave before sleeping/(N)o
as_m.entries.emplace_back( 0, true,
get_option<bool>( "FORCE_CAPITAL_YN" ) ? 'Y' : 'y',
_( "Yes." ) );
as_m.entries.emplace_back( 1, g->get_moves_since_last_save(),
get_option<bool>( "FORCE_CAPITAL_YN" ) ? 'S' : 's',
_( "Yes, and save game before sleeping." ) );
as_m.entries.emplace_back( 2, true,
get_option<bool>( "FORCE_CAPITAL_YN" ) ? 'N' : 'n',
_( "No." ) );
as_m.entries.emplace_back( 1, g->get_moves_since_last_save(),
get_option<bool>( "FORCE_CAPITAL_YN" ) ? 'S' : 's',
_( "Yes, and save game before sleeping." ) );
as_m.entries.emplace_back( 0, true,
get_option<bool>( "FORCE_CAPITAL_YN" ) ? 'Y' : 'y',
_( "Yes." ) );

// List all active items, bionics or mutations so player can deactivate them
std::vector<std::string> active;
for( auto &it : u.inv_dump() ) {
if( it->active && ( it->charges > 0 || it->units_remaining( u ) > 0 ) &&
it->is_transformable() ) {
it->is_tool() ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fun thing: a lit cigar is not a tool and would also not pass this test because it does not have charges, I think (just tested, got everything on fire).

Since the other day I read on reddit that someone started bionic operation (ie: anesthesia) while smoking a lit cigar and that caused them to start a fire, for this reason I think that we should also consider lit items as things to notify:

So I think we should do something like

it->has_flag( flag_LITCIG ) || ( it->active && ( it->charges > 0 || it->units_remaining( u ) > 0 ) && it->is_tool() )

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only items that have destructive effect that are not tools that I found were, besides cigarettes, non-lethal grenades (insecticide, fungicide, smoke).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thinking!!! Added your idea.
I'm not at home right now, so a new screenshot will have to wait til tomorrow.

The only bad thing is:
Now I have to think of a new sentence that fits the lit cigar ;-)
--> You may want to turn off:
Any suggestions?

Can't think of anything good.
-> You may want to take care of:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that "You may want to take care of:" is great. Alternativaly, something like "You may want to put out the following:" or "It might be safer to shut off the following before sleeping:"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll go with "The following may have slipped your mind:". What do you think?
BTW - Tests fail. I'll take a closer look tomorrow.

active.push_back( it->tname() );
}
}
Expand Down Expand Up @@ -959,10 +959,10 @@ static void sleep()
std::stringstream data;
if( !active.empty() ) {
data << as_m.text << std::endl;
data << _( "You may want to deactivate these before you sleep." ) << std::endl;
data << _( "You may want to turn off:" ) << std::endl;
data << " " << std::endl;
for( auto &a : active ) {
data << a << std::endl;
data << "<color_red>" << a << "</color>" << std::endl;
}
as_m.text = data.str();
}
Expand Down