57 const float buttonWidth = 200.0f;
58 const float buttonHeight = 50.0f;
59 const float spacing = 20.0f;
62 const float totalHeight = (buttonHeight * 4.0f) + (spacing * 3.0f);
63 const float offsets[4] = {
64 -(totalHeight / 2.0f) + (buttonHeight / 2.0f),
65 -(totalHeight / 2.0f) + (buttonHeight / 2.0f) + buttonHeight + spacing,
66 (totalHeight / 2.0f) - (buttonHeight / 2.0f) - buttonHeight - spacing,
67 (totalHeight / 2.0f) - (buttonHeight / 2.0f)
81 const float profileBtnWidth = 120.0f;
82 const float profileBtnHeight = 40.0f;
83 const float margin = 20.0f;
void SetOnSettings(std::function< void()> onSettings)
Set callback triggered when the Settings button is clicked.
void SetScreenSize(float width, float height)
Set screen size for layout calculations.
std::function< void()> _onQuit
void SetProfileName(const std::string &name)
Update the text of the Profile button (e.g. "GUEST" -> "PlayerName").
void SetOnSelectServer(std::function< void()> onSelectServer)
Set callback triggered when the Select Server button is clicked.
void Show() override
Show the menu and play the open sound effect.
std::function< void()> _onPlay
std::shared_ptr< UI::IButton > _profileButton
MainMenu(UI::IUIFactory &uiFactory)
void OnSelectServerClicked()
std::function< void()> _onProfile
std::function< void()> _onSettings
void SetOnPlay(std::function< void()> onPlay)
Set callback triggered when the Play button is clicked.
void SetOnQuit(std::function< void()> onQuit)
Set callback triggered when the Quit button is clicked.
void Initialize() override
Initialize menu (must be implemented by derived classes).
void SetOnProfile(std::function< void()> onProfile)
Set callback triggered when the Profile/Guest button is clicked.
std::function< void()> _onSelectServer