|
R-Type
Distributed multiplayer game engine in C++
|
Victory screen displayed when the player wins the level. More...
#include <VictoryMenu.hpp>


Public Member Functions | |
| VictoryMenu (UI::IUIFactory &uiFactory) | |
| Construct a new VictoryMenu. | |
| ~VictoryMenu () override=default | |
| void | Initialize () override |
| Initialize UI elements (creates buttons and text). | |
| void | SetOnReturnToMenu (std::function< void()> callback) |
| Set callback invoked when user clicks return to menu button. | |
| void | SetVictoryMessage (const std::string &message) |
| Set the victory message to display. | |
| void | Render () override |
| Custom render to display victory message. | |
Public Member Functions inherited from Game::BaseMenu | |
| BaseMenu (UI::IUIFactory &uiFactory) | |
| Constructor with UI factory reference. | |
| virtual | ~BaseMenu ()=default |
| Virtual destructor. | |
| virtual void | Update () |
| Update menu state (should be called every frame). | |
| virtual void | Show () |
| Show the menu. | |
| virtual void | Hide () |
| Hide the menu. | |
| virtual bool | IsVisible () const |
| Check if menu is currently visible. | |
| void | SetSoundEffectService (Audio::ISoundEffectService *soundService) |
| Set the sound effect service for playing UI sounds. | |
Private Member Functions | |
| void | OnReturnToMenuClicked () |
Private Attributes | |
| std::function< void()> | _onReturnToMenu {} |
| std::string | _victoryMessage {"VICTORY!"} |
Additional Inherited Members | |
Protected Member Functions inherited from Game::BaseMenu | |
| std::function< void()> | WrapWithClickSound (std::function< void()> callback) |
| Wrap a callback to play click sound before executing. | |
| std::shared_ptr< UI::IButton > | CreateCenteredButton (const char *label, float offsetY, float width, float height, unsigned int backgroundColor, unsigned int hoverColor, std::function< void()> callback) |
| Create a button with standard styling and positioning. | |
Protected Attributes inherited from Game::BaseMenu | |
| UI::IUIFactory & | _uiFactory |
| std::shared_ptr< UI::IMenu > | _menu |
| Audio::ISoundEffectService * | _soundService {nullptr} |
Victory screen displayed when the player wins the level.
Shows victory message and allows player to return to main menu or continue.
Definition at line 23 of file VictoryMenu.hpp.
|
explicit |
Construct a new VictoryMenu.
| uiFactory | UI factory used to create menus and buttons. |
Definition at line 12 of file VictoryMenu.cpp.
|
overridedefault |
|
overridevirtual |
Initialize UI elements (creates buttons and text).
Implements Game::BaseMenu.
Definition at line 14 of file VictoryMenu.cpp.
References Game::BaseMenu::_menu, Game::BaseMenu::CreateCenteredButton(), OnReturnToMenuClicked(), and Game::BaseMenu::WrapWithClickSound().

|
private |
Definition at line 50 of file VictoryMenu.cpp.
References _onReturnToMenu, and LOG_INFO.
Referenced by Initialize().
|
overridevirtual |
Custom render to display victory message.
Reimplemented from Game::BaseMenu.
Definition at line 38 of file VictoryMenu.cpp.
References Game::BaseMenu::IsVisible(), and Game::BaseMenu::Render().

| void Game::VictoryMenu::SetOnReturnToMenu | ( | std::function< void()> | callback | ) |
Set callback invoked when user clicks return to menu button.
Definition at line 30 of file VictoryMenu.cpp.
References _onReturnToMenu.
| void Game::VictoryMenu::SetVictoryMessage | ( | const std::string & | message | ) |
Set the victory message to display.
| message | Victory message (e.g., "Level Complete!", "Victory!") |
Definition at line 34 of file VictoryMenu.cpp.
References _victoryMessage.
|
private |
Definition at line 56 of file VictoryMenu.hpp.
Referenced by OnReturnToMenuClicked(), and SetOnReturnToMenu().
|
private |
Definition at line 57 of file VictoryMenu.hpp.
Referenced by SetVictoryMessage().