Addition of the Skip Feature in the Source Academy Game#3732
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a dialogue skip feature, allowing players to fast-forward through dialogue until the next prompt or the end of the sequence. It includes a new skip button, a keyboard shortcut ('S'), and a 'Skip Confirm' setting in the escape menu to toggle a confirmation prompt. The implementation also refines the game's saving logic during location changes to avoid redundant saves. Feedback focuses on fixing a potential hang in the skip loop, improving the responsiveness of the skip delay, avoiding fragile 'any' casts for private member access, and externalizing hardcoded asset paths.
|
Thanks for updating the PR! As noted by sentry (and I do think its a valid point), there appears to be an issue when trying to access the 3rd item (index 2) of the |
| } | ||
|
|
||
| if (!this.skipButton || !this.skipButton.active) { | ||
| this.isSkipping = false; | ||
| break; | ||
| } | ||
|
|
||
| if (hasPrompt || hasActions) { | ||
| this.isSkipping = false; | ||
| break; | ||
| } |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
…nto pr/ItsByt/3732
Description
Summary of change:
This PR proposes the new implementation of the skip feature in the Source Academy Game, which enables users to skip through dialogue.
Type of change
Motivation and Context:
Users may feel that some dialogues are particularly too lengthy, and would want some way to skip through it conveniently without having to repeatedly click through the dialogue. This feature enables users to skip through dialogue with the click of a button (the skip button), or by clicking the "s" button on their keyboard. To prevent accidental usage, users can also toggle in their settings whether to have a confirmation appear whenever they use the skip button. If on, they will be prompted with the confirmation on their usage, and if off, any use of the skip feature immediately skips through the dialogue.
We also note that the skip feature only skips until the next required prompt by the user (e.g. location changes, questions that require the user to give an answer etc.), or the end of the dialogue. Trying to re-use the skip feature will not skip any further in such cases.
Also note that the default setting for the confirmation setting is for the confirmation to be turned ON. Users will have to manually turn this confirmation off should they want no confirmation. However, once turned off, the settings will be saved between chapters and users need not re-turn it off every time.
How to test
Choose any chapter (I chose Chapter 0 for simplicity and as it is the easiest to illustrate)
Basic.Usage.of.Skip.Feature.mp4
When in a dialogue, there should now be blue button at the top right corner of the dialogue box. Click it to skip through dialogue. The above is with the confirmation settings turned on.
Using.no.confirmation.setting.mp4
The above is when the confirmation settings is turned off.
Using.the.s.keyboard.shorcut.mp4
The above is when we use the "s" keyboard shortcut to skip through the dialogue. Note that this works regardless of whether we have the confirmation turned on or off. It is simply the equivalent of clicking the skip button.
Skipping.when.not.able.to.is.useless.mp4
We note that trying to use the skip button is useless if they are already at a point in the dialogue that cannot be progressed any further without their direct prompt. In the case where a user is explicitly required to answer a question, I have hidden the button so that it is not clickable directly on their screen until the prompt is answered, and temporarily disabled the "s" keyboard shortcut so clicking it does nothing in that instance.
Checklist