Pause Menu Visual Design Revision 1

This commit is contained in:
2025-04-09 04:36:16 -05:00
parent 79d8720282
commit 1cbed8ce7f
3 changed files with 32 additions and 5 deletions

View File

@@ -22,7 +22,6 @@ namespace CaveGame::Client
/// It is safe to assume the parent will **ALWAYS** be the Scene* instance GameSession::hud.
explicit PauseMenuWidget(Widget* parent);
// TODO: This function signature will return void in the next JUI release.
void ObserveMouseInput(JUI::MouseButton btn, bool pressed) override;
@@ -34,7 +33,7 @@ namespace CaveGame::Client
/// @return The state of the PauseMenu.
[[nodiscard]] bool GetOpen() const;
Q
/// Sets the state of the PauseMenu to "Open".
void Open() { SetOpen(true); }

View File

@@ -242,7 +242,7 @@ void CaveGame::Client::GameSession::PassWindowSize(const Vector2 &size) {
void CaveGame::Client::GameSession::PassKeyInput(Key key, bool pressed) {
// DO NOT chain input conditions with else; you will introduce biasing
if (key == Keys::Escape)
if (key == Keys::Escape && pressed)
pause_menu->Toggle();
hud->ObserveKeyInput(key, pressed);

View File

@@ -6,20 +6,48 @@ namespace CaveGame::Client
PauseMenuWidget::PauseMenuWidget() {
this->Size({100_percent, 100_percent}); // Full Screen.
this->BGColor({128, 128, 128, 128}); // Transparent Gray.
this->BGColor({32, 32, 32, 128}); // Transparent Gray.
this->ZIndex(1);
button_box = new JUI::Rect(this);
button_box->Size({150_px, 150_px});
button_box->AnchorPoint({0.f, 1.f});
button_box->Position({50_px, 100_percent - 50_px});
button_list = new JUI::VerticalListLayout(button_box);
resume_btn = new JUI::TextButton(button_list);
resume_btn->Size({100_percent, 50_px});
resume_btn->CornerRounding(7);
resume_btn->Center();
resume_btn->SetTextSize(24);
resume_btn->SetTextColor(Colors::White);
resume_btn->BaseBGColor(Colors::DarkGray);
resume_btn->HoveredBGColor(Colors::Blues::LightSteelBlue);
resume_btn->BGColor(resume_btn->BaseBGColor());
resume_btn->SetContent("Resume");
settings_btn = new JUI::TextButton(button_list);
settings_btn->Size({100_percent, 50_px});
settings_btn->CornerRounding(7);
settings_btn->Center();
settings_btn->SetTextSize(24);
settings_btn->SetTextColor(Colors::White);
settings_btn->BaseBGColor(Colors::DarkGray);
settings_btn->HoveredBGColor(Colors::Blues::LightSteelBlue);
settings_btn->BGColor(settings_btn->BaseBGColor());
settings_btn->SetContent("Settings");
quit_btn = new JUI::TextButton(button_list);
quit_btn->Size({100_percent, 50_px});
quit_btn->CornerRounding(7);
quit_btn->Center();
quit_btn->SetTextSize(24);
quit_btn->SetTextColor(Colors::White);
quit_btn->BaseBGColor(Colors::DarkGray);
quit_btn->HoveredBGColor(Colors::Blues::LightSteelBlue);
quit_btn->BGColor(quit_btn->BaseBGColor());
quit_btn->SetContent("Save & Exit World");
// Default-initialize as closed.