Milestone 11: Dedicated gameplay settings menu for difficulty, Part #5
Summary by @sourcery-ai & @coderabbitai
Introduce a dedicated gameplay settings menu for difficulty management and integrate it into existing UI flows and web overlays while updating security analysis tooling versions.
New Features:
- Add a standalone gameplay settings scene and script with difficulty slider, back, and reset controls, integrated into the options menu and web shell UI. @ikostan
- Added a Gameplay Settings panel in Options with an adjustable difficulty slider, Back and Reset actions, and web-overlay (browser) integration. @ikostan
Enhancements:
- Refactor difficulty handling out of the options menu into the new gameplay settings flow, including JavaScript bridge callbacks, hidden menu stack usage, and DOM overlay visibility updates.
- Improve JavaScript callback management in the main menu and advanced settings to avoid garbage collection issues and harden argument validation.
- Adjust web overlay navigation so options, audio, controls, advanced, and gameplay menus show and hide the correct HTML elements.
CI:
- Bump GitHub CodeQL action versions in security and analysis workflows to the latest pinned releases. @dependabot
Deployment:
- Update SARIF upload steps in Snyk and Trivy workflows to use the newer pinned github/codeql-action/upload-sarif revision. @dependabot
Tests:
- Extend the difficulty flow end-to-end test to navigate through the gameplay settings menu and use its back-navigation callbacks when returning to the main menu. @ikostan
- Extend difficulty and navigation end-to-end tests to cover the gameplay settings screen, its reset/back flows, and more reliable JS-driven navigation. @ikostan
- Increase main menu load wait time in tests to better tolerate engine initialization on web exports. @ikostan
- Updated automated tests to follow Options → Gameplay Settings navigation and overlay element checks. @ikostan
CI:
- Bump GitHub CodeQL action versions in the CodeQL workflow to the latest v4.32.2 release. @dependabot
Deployment:
- Update Snyk and Trivy workflows to use newer pinned github/codeql-action/upload-sarif revisions for SARIF uploads. @dependabot
Style:
- Renamed Difficulty → Gameplay, updated button/label sizing and styling for improved layout and presentation. @ikostan
Chores:
- CI workflow actions and SARIF upload steps updated to newer action versions. @dependabot
Reviewer's Guide
Introduce a dedicated Gameplay Settings menu/scene for difficulty management, refactor options and web overlay integration to route difficulty changes and navigation through this new screen, update automated tests to follow the new flow, and bump CodeQL/SARIF-related CI actions.
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Add a dedicated Gameplay Settings scene and script that own difficulty configuration, including web overlay integration and robust JS callback handling. |
|
scripts/gameplay_settings.gdscenes/gameplay_settings.tscn |
| Refactor Options menu to launch Gameplay Settings instead of embedding the difficulty slider, and expose new gameplay navigation callbacks to the web shell. |
|
scripts/options_menu.gdscenes/options_menu.tscn |
| Integrate Gameplay Settings into the HTML shell and other menus, and ensure JS callbacks are pinned to avoid garbage collection issues in web builds. |
|
custom_shell.htmlscripts/advanced_settings.gdscripts/audio_settings.gdscripts/main_menu.gdscenes/advanced_settings.tscn |
| Update Playwright-style end-to-end tests to navigate through Gameplay Settings and validate the new overlay behavior and timings. |
|
tests/difficulty_flow_test.pytests/back_flow_test.pytests/navigation_to_audio_test.pytests/reset_audio_flow_test.pytests/load_main_menu_test.py |
| Bump CodeQL and SARIF upload GitHub Actions to newer pinned versions for security analysis, Snyk, and Trivy workflows. |
|
.github/workflows/codeql.yml.github/workflows/snyk.yml.github/workflows/trivy.yml |
Assessment against linked issues
| Issue | Objective | Addressed | Explanation |
|---|---|---|---|
| #312 | Create a dedicated gameplay settings scene (gameplay_settings.tscn + gameplay_settings.gd) containing the difficulty slider UI, labels, back and reset controls, and logic to update/display difficulty and navigate back. |
✅ | |
| #312 | Refactor the options menu to remove the embedded difficulty controls, add a Gameplay/GamePlay Settings button, and wire it (including web overlay/JS callbacks) to open the new gameplay settings screen. | ✅ | |
| #312 | Ensure difficulty changes made via the new gameplay settings menu persist (using existing global settings) and continue to influence gameplay, with automated tests updated to cover the new navigation and difficulty flow. | ✅ |
Possibly linked issues
- #: The PR creates the gameplay_settings scene, moves difficulty controls there, updates options navigation, and adjusts web overlays/tests accordingly.