-
Notifications
You must be signed in to change notification settings - Fork 258
Sokoban: Fix player movement during introductory dialogue #1124
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
Conversation
|
Test build no longer available. |
manuq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the bug! Excellent!
Two things before merging:
- Please fix the coding styles by applying my suggestions.
- The pull request title is good! But please improve the pull request description. Here are our guidelines: https://github.com/endlessm/threadbare/blob/main/docs/CONTRIBUTING.md#git-commit-messages-and-pull-request-descriptions . You already have a good description of the problem and what's the solution you made in your planning sheet, so you can use it for the pull request description by translating some parts to English.
| func _unhandled_input(event: InputEvent)-> void: | ||
| # Handle newly-pressed input directions | ||
| if Input.is_action_just_pressed(action_up): | ||
| if event.is_action_pressed(action_up): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, InputEvent doesn't have is_action_just_pressed() or is_action_just_released so these changes are correct.
|
|
||
|
|
||
| func _process(delta: float) -> void: | ||
| func _unhandled_input(event: InputEvent)-> void: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a detail: the coding style is to have a space character between the ->:
| func _unhandled_input(event: InputEvent)-> void: | |
| func _unhandled_input(event: InputEvent) -> void: |
You can read about the coding style in https://github.com/endlessm/threadbare/blob/main/docs/CONTRIBUTING.md#coding-style . It also tells you how to enforce it when you commit.
And also the coding style checks run automatically for each pull request. Here you can see that it fixed this and the issue below (2 blank lines before func) https://github.com/endlessm/threadbare/actions/runs/17248081317/job/49005301658?pr=1124
scenes/eternal_loom_sokoban/components/system/input/directional_input.gd
Show resolved
Hide resolved
Previously, the player could still move during the introductory dialogue at the beginning of the first Sokoban puzzle. This happened because input was handled in `_process()` instead of `_unhandled_input()`, contrary to Dialogue Manager’s documentation. In the main game, the Player was already migrated to `_unhandled_input` (commit 58e81c9), so Sokoban should behave consistently. This change updates the Sokoban Player script to handle input through `_unhandled_input()` and blocks player control while dialogue is active. Once the dialogue finishes, control is restored normally. Success criteria: - The player cannot move while the dialogue is active. - Player control is enabled only after the dialogue ends. - Input handling in Sokoban is now consistent with the rest of the game. - No regressions occur in normal Sokoban gameplay after dialogue. Fixes endlessm#493
Previously, the player could still move during the introductory
dialogue at the beginning of the first Sokoban puzzle. This happened
because input was handled in
_process()instead of_unhandled_input(),contrary to Dialogue Manager’s documentation. In the main game, the
Player was already migrated to
_unhandled_input9cbeae3,so Sokoban should behave consistently.
This change updates the Sokoban Player script to handle input
through
_unhandled_input()and blocks player control while dialogueis active. Once the dialogue finishes, control is restored normally.
Success criteria:
Fixes #493