Skip to content

[GEN][ZH] Unblock keyboard input on CRC mismatch #1209

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3779,6 +3779,9 @@ void GameLogic::pauseGameMusic(Bool paused)
// ------------------------------------------------------------------------------------------------
void GameLogic::pauseGameInput(Bool paused)
{
// unblock keyboard input if blocked by scripts
TheWindowManager->winSetFocus(NULL);
Copy link

Choose a reason for hiding this comment

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

Is this implementation correct? I think this means that when continuining the sequence, then input remains unblocked.

Copy link
Author

Choose a reason for hiding this comment

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

Is this implementation correct? I think this means that when continuining the sequence, then input remains unblocked.

Is that an issue? I could make it for replays only, but I doubt it's needed.

Copy link

Choose a reason for hiding this comment

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

It should be possible to detect current state, overwrite it, and then revert state when done. This way there will be no unexpected bugs.

Copy link
Author

Choose a reason for hiding this comment

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

I think this is unnecessary when playing replays. In fact, I'd rather have the keyboard never blocked for replays.

We could just check if we're in replay mode.

Copy link

Choose a reason for hiding this comment

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

Ok but that is a different area of concern right? Touching setGamePaused only concerns how the pausing handles the inputs, not if the inputs already changed before that.

The correct fix here is to make setGamePaused universially robust. It does not care about the context it is called from. It just applies its desired effect from whatever context - when possible.


if(m_pauseInput == paused)
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4346,6 +4346,9 @@ void GameLogic::pauseGameMusic(Bool paused)
// ------------------------------------------------------------------------------------------------
void GameLogic::pauseGameInput(Bool paused)
{
// unblock keyboard input if blocked by scripts
TheWindowManager->winSetFocus(NULL);

if(m_pauseInput == paused)
return;

Expand Down
Loading