Skip to content

Add toggle menu item to main menu and menu system#81

Merged
colinkiama merged 5 commits intomainfrom
60-add-toggle-menu-item-to-main-menu-and-menu-system
Mar 17, 2025
Merged

Add toggle menu item to main menu and menu system#81
colinkiama merged 5 commits intomainfrom
60-add-toggle-menu-item-to-main-menu-and-menu-system

Conversation

@colinkiama
Copy link
Copy Markdown
Owner

This pull request includes several updates to the game's scene management and event handling, as well as some refactoring to improve code maintainability. The most important changes include adding a new pause event, updating high score retrieval and storage, and refactoring interactive elements in various scenes.

Event Handling Improvements:

  • Added a new PAUSE_REQUESTED event to CrossSceneEvent in src/constants/events.js to handle pause requests across scenes.
  • Updated Battle scene to handle PAUSE_REQUESTED event and launch the pause menu with an additional parameter. [1] [2] [3]
  • Modified HUD scene to emit PAUSE_REQUESTED event instead of directly launching the pause menu.

High Score Management:

  • Updated high score retrieval and storage to use this.registry instead of this.game.registry in Battle, HUD, and Preloader scenes for consistency. [1] [2] [3] [4]

Interactive Elements Refactoring:

  • Refactored Controls and Credits scenes to store interactive items and properly clean up event listeners on shutdown. [1] [2] [3] [4]
  • Added onBackButtonPressForInstance and onButtonPressForInstance functions to handle button presses in a more modular way. [1] [2]

Menu System Enhancements:

  • Updated MainMenu and PauseMenu scenes to dynamically update sound toggle labels based on the current sound state and handle data changes for sound preferences. [1] [2] [3] [4]

Code Cleanup:

  • Removed unused WEBSITE_URL import from Controls, Credits, and MainMenu scenes. [1] [2] [3]
  • Removed unused _tweenTimeline property from GameOver scene.

Fixes #60

@colinkiama colinkiama linked an issue Mar 17, 2025 that may be closed by this pull request
@colinkiama colinkiama merged commit 5fb1926 into main Mar 17, 2025
@colinkiama colinkiama deleted the 60-add-toggle-menu-item-to-main-menu-and-menu-system branch March 17, 2025 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add toggle menu item to Main Menu and Menu System

1 participant