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

Make ESC key stop trying to sleep #37716

Merged

Conversation

wapcaplet
Copy link
Contributor

Summary

SUMMARY: Interface "Make ESC key stop trying to sleep"

Purpose of change

To make the behavior of the Escape key in the "You have trouble sleeping" menu more consistent with other popup menus for actions.

In most other popup prompts in the game, pressing ESC cancels whatever was being attempted, and generally prevents any further actions or time passing. Unlike these, the "You have trouble sleeping" prompt would continue trying to sleep and cause more time to pass when ESC was pressed.

Describe the solution

One line is added to the case statement for this menu, causing a UILIST_CANCEL result to be caught along with case 1 ("S"), instead of falling through the end with case 2 ("c") and causing the sleep attempt to be repeated.

Describe alternatives you've considered

I considered also adding some indicator to the menu about what ESC would do, but I don't see that in any other menus.

Testing

Loaded a debugging world, tried to sleep several times while not sleepy, and ensured that ESC canceled the action as expected. Other keypresses continue to work as expected.

Additional context

This has bothered me since I first started playing Cataclysm and it was about time I did something about it. I doubt I am the only one surprised / annoyed by it.

This screenshot shows the affected menu and how the behavior changed:

image

In most other popup prompts in the game, pressing ESC cancels whatever
was being attempted, and generally prevents any further actions or time
passing.

Before this commit, the "You have trouble sleeping, keep trying?" prompt
would treat ESC as synonymous with "c", or "Continue trying to fall
asleep." In other words, ESC did not cancel or escape the menu, as a
player would expect from the behavior of other ingame menus.

After this commit, pressing ESC in the "You have trouble sleeping"
prompt is the same as "S", "Stop trying to fall asleep and get up."
This is the quickest shortcut to cancel the sleeping action, and stop
time from continuing to pass.
@anothersimulacrum
Copy link
Member

Nice job, this keeps catching me too!

@ZhilkinSerg ZhilkinSerg added Info / User Interface Game - player communication, menus, etc. Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA labels Feb 5, 2020
@ZhilkinSerg ZhilkinSerg merged commit 8ba6a61 into CleverRaven:master Feb 5, 2020
@wapcaplet wapcaplet deleted the wapcaplet-escape-cancel-sleep branch February 6, 2020 02:12
@brndd
Copy link
Contributor

brndd commented Feb 11, 2020

In the "[enemy] sighted. Cancel current action?" -type dialogs, which can happen when eg. reloading or aiming when enemies pop into view, pressing escape will also resume the action instead of canceling it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Info / User Interface Game - player communication, menus, etc. Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants