Skip to content

Conversation

@ZTL-UwU
Copy link
Contributor

@ZTL-UwU ZTL-UwU commented Nov 30, 2025

No description provided.

Signed-off-by: ZTL-UwU <zhangtianli2006@gmail.com>
Signed-off-by: ZTL-UwU <zhangtianli2006@gmail.com>
@ZTL-UwU ZTL-UwU marked this pull request as ready for review November 30, 2025 01:36
@szdytom szdytom requested a review from Copilot November 30, 2025 02:29
@szdytom szdytom merged commit 931ca0b into szdytom:main Nov 30, 2025
6 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds dynamic window title functionality to the game, allowing each scene to set an appropriate window title when it becomes active. The implementation adds a new setWindowTitle method to SceneManager and updates all scene setup() methods to set descriptive titles.

  • Added SceneManager::setWindowTitle() method to enable scenes to update the window title
  • Updated all scene setup() methods to set appropriate window titles ("Settings", "Help", "Credits", "Level Selection", and formatted level names)
  • Enhanced the level menu UI by splitting the play hint into separate "Play" and "[Enter]" text elements with different styling

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
include/wforge/scene.h Added setWindowTitle method declaration and _play_hint UI descriptor field
src/scenes/scene.cpp Implemented setWindowTitle method to update window title
src/scenes/settings.cpp Added window title "Settings" in setup method
src/scenes/main_menu.cpp Added window title with version string in setup method
src/scenes/level_menu.cpp Added window title "Level Selection" and separated play hint rendering
src/scenes/level.cpp Added dynamic window title with level number and name
src/scenes/help.cpp Added window title "Help" in setup method
src/scenes/credits.cpp Added window title "Credits" in setup method
assets/ui/level-menu.json Split enter-hint configuration into separate play-hint and enter-hint entries

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

_scene_changed = true;
}

void SceneManager::setWindowTitle(std::string title) {
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title parameter should be passed by const reference (const std::string&) instead of by value to avoid unnecessary string copies. This improves performance and follows C++ best practices for passing strings to functions that don't need ownership.

Suggested change
void SceneManager::setWindowTitle(std::string title) {
void SceneManager::setWindowTitle(const std::string& title) {

Copilot uses AI. Check for mistakes.
void changeScene(Scene new_scene);
void handleEvent(sf::Event &evt);
void tick();
void setWindowTitle(std::string title);
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title parameter should be passed by const reference (const std::string&) instead of by value to avoid unnecessary string copies. This improves performance and follows C++ best practices for passing strings to functions that don't need ownership.

Suggested change
void setWindowTitle(std::string title);
void setWindowTitle(const std::string& title);

Copilot uses AI. Check for mistakes.
}

void MainMenu::setup(SceneManager &mgr) {
mgr.setWindowTitle("Waveforge " WAVEFORGE_VERSION "alpha");
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space between the version string and "alpha". This should be "Waveforge " WAVEFORGE_VERSION " alpha" to ensure proper spacing in the window title.

Suggested change
mgr.setWindowTitle("Waveforge " WAVEFORGE_VERSION "alpha");
mgr.setWindowTitle("Waveforge " WAVEFORGE_VERSION " alpha");

Copilot uses AI. Check for mistakes.
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.

2 participants