Putting together PauseMenu functionality.
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
/// @edit 1/28/2025
|
||||
/// @auth Josh O'Leary
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Client/Scene.hpp>
|
||||
|
@@ -49,6 +49,14 @@ namespace CaveGame::Client {
|
||||
input_section->Title("Input");
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool GetOpen() const;
|
||||
void SetOpen(bool value);
|
||||
void Toggle();
|
||||
void Open();
|
||||
void Close();
|
||||
|
||||
protected:
|
||||
JUI::Collapsible* general_section;
|
||||
JUI::Collapsible* sound_section;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#include <Client/GameSession.hpp>
|
||||
#include <Core/Loggers.hpp>
|
||||
#include <Client/SettingsMenu.hpp>
|
||||
#include <JUI/Widgets/Rect.hpp>
|
||||
#include <JUI/Widgets/ListLayout.hpp>
|
||||
#include <JUI/UDim.hpp>
|
||||
@@ -26,6 +27,9 @@ void CaveGame::Client::GameSession::Load() {
|
||||
hud = new JUI::Scene();
|
||||
|
||||
pause_menu = new PauseMenuWidget(hud);
|
||||
pause_menu->OnQuitButtonPressed += [this] (){ SaveAndExit();};
|
||||
pause_menu->OnResumeButtonPressed += [this] () { pause_menu->Close(); };
|
||||
pause_menu->OnSettingsButtonPressed += [this] () { Client::SettingsMenu::Instance().Open(); };
|
||||
|
||||
hotbar = TileHotbar();
|
||||
// TODO: Redundant, use the constructor.
|
||||
|
@@ -10,11 +10,14 @@ namespace CaveGame::Client
|
||||
this->ZIndex(1);
|
||||
|
||||
button_box = new JUI::Rect(this);
|
||||
button_box->Size({150_px, 150_px});
|
||||
button_box->Size({150_px, 170_px});
|
||||
button_box->AnchorPoint({0.f, 1.f});
|
||||
button_box->Position({50_px, 100_percent - 50_px});
|
||||
button_box->BGColor(Colors::Transparent);
|
||||
button_box->BorderWidth(0);
|
||||
|
||||
button_list = new JUI::VerticalListLayout(button_box);
|
||||
button_list->PaddingBottom(5_px);
|
||||
|
||||
|
||||
resume_btn = new JUI::TextButton(button_list);
|
||||
|
@@ -3,11 +3,8 @@
|
||||
#include "Client/AssetService.hpp"
|
||||
CaveGame::Client::Splash::Splash() : Scene()
|
||||
{
|
||||
|
||||
//font = JGL::Font();
|
||||
|
||||
ComputeMatrixGlyphTable();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -120,15 +117,9 @@ void CaveGame::Client::Splash::Update(float elapsed)
|
||||
|
||||
AssetService::Get()->LoadFromQueue();
|
||||
|
||||
|
||||
load_percent = (float)AssetService::Get()->TotalLoaded() / (float)AssetService::Get()->TotalQueued();
|
||||
|
||||
//if (load_percent < 1)
|
||||
//load_percent += elapsed/2.f;
|
||||
//else
|
||||
//load_percent = 1;
|
||||
|
||||
//splash_timer -= elapsed;
|
||||
|
||||
}
|
||||
|
||||
void CaveGame::Client::Splash::Load() {
|
||||
@@ -137,7 +128,6 @@ void CaveGame::Client::Splash::Load() {
|
||||
ComputeMatrixTextureCache();
|
||||
|
||||
Scene::Load();
|
||||
|
||||
}
|
||||
|
||||
void CaveGame::Client::Splash::Unload() {
|
||||
|
Reference in New Issue
Block a user