Skip to content

Milestone 11: Dedicated gameplay settings menu for difficulty, Part #5

Choose a tag to compare

@github-actions github-actions released this 10 Feb 09:21
· 158 commits to main since this release
1200d5b

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.

image image

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.
  • Introduce gameplay_settings.gd with slider-driven difficulty updates wired to Globals, reset/back buttons, and guarded JS callback handlers for changeDifficulty, gameplayBackPressed, and gameplayResetPressed.
  • Implement lifecycle cleanup in gameplay_settings.gd (tree_exited) that disconnects signals, unsets JS callbacks, manages Globals.hidden_menus, and restores or hides web overlay elements appropriately.
  • Create gameplay_settings.tscn UI with difficulty slider, label, back, and reset controls nested under a panel layout consistent with other settings screens.
scripts/gameplay_settings.gd
scenes/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.
  • Remove difficulty slider and label nodes/logic from options_menu.gd and replace with a Gameplay Settings button that instantiates the new gameplay_settings scene and participates in the hidden_menus stack.
  • Update options_menu.gd web-overlay DOM manipulation to toggle #gameplay-button instead of #difficulty-slider and wire a gameplayPressed JS callback to open the Gameplay Settings screen.
  • Adjust back-navigation and submenu-entry handlers in options_menu.gd to hide/show #gameplay-button alongside the existing audio/controls/advanced buttons.
scripts/options_menu.gd
scenes/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.
  • Extend custom_shell.html with a GAMEPLAY SETTINGS button plus gameplay back/reset buttons, and wire their onclick handlers to window.gameplayPressed, window.gameplayBackPressed, and window.gameplayResetPressed while repurposing the difficulty slider to be shown from the gameplay screen.
  • Update advanced_settings.gd and audio_settings.gd to reference #gameplay-button instead of #difficulty-slider when restoring the options overlay after exiting their menus.
  • In main_menu.gd, store JavaScriptBridge callback objects (start/options/quit) on member variables to prevent GC and explicitly assign them to window.*Pressed to keep web overlay interactions reliable.
custom_shell.html
scripts/advanced_settings.gd
scripts/audio_settings.gd
scripts/main_menu.gd
scenes/advanced_settings.tscn
Update Playwright-style end-to-end tests to navigate through Gameplay Settings and validate the new overlay behavior and timings.
  • Modify difficulty_flow_test.py to enter Gameplay Settings via #gameplay-button, change difficulty through window.changeDifficulty, then return using window.gameplayBackPressed before exiting to main menu with window.optionsBackPressed.
  • Adjust back_flow_test.py and navigation_to_audio_test.py to assert restoration of the options overlay via #gameplay-button visibility instead of #difficulty-slider after backing out of submenus.
  • Stabilize web navigation tests by waiting for JS callbacks (e.g., window.optionsPressed) before invoking them, and lengthen initial load_main_menu_test.py timeouts to accommodate engine initialization latency.
tests/difficulty_flow_test.py
tests/back_flow_test.py
tests/navigation_to_audio_test.py
tests/reset_audio_flow_test.py
tests/load_main_menu_test.py
Bump CodeQL and SARIF upload GitHub Actions to newer pinned versions for security analysis, Snyk, and Trivy workflows.
  • Update github/codeql-action init/autobuild/analyze steps in codeql.yml from v4.32.0 to v4.32.2.
  • Change the pinned SHA for github/codeql-action/upload-sarif in snyk.yml to the latest specified revision for Snyk SARIF uploads.
  • Update Trivy’s upload-sarif step to a newer pinned SHA corresponding to github/codeql-action v4.32.2.
.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.