mirror of
https://github.com/izzy2lost/Ghostship.git
synced 2026-06-19 01:17:03 -07:00
Bump LUS and implemented Menu Bar
This commit is contained in:
+2
-2
@@ -15,8 +15,8 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
|
||||
set(CMAKE_C_STANDARD 11 CACHE STRING "The C standard to use")
|
||||
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
|
||||
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MT>)
|
||||
#add_compile_options(-fsanitize=address)
|
||||
#add_link_options(-fsanitize=address)
|
||||
# add_compile_options(-fsanitize=address)
|
||||
# add_link_options(-fsanitize=address)
|
||||
|
||||
# Add a custom module path to locate additional CMake modules
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
||||
|
||||
+1
-1
Submodule libultraship updated: 9c54a9200a...2a1ce0001d
+18
-1
@@ -8,6 +8,7 @@
|
||||
#include <Fast3D/gfx_pc.h>
|
||||
|
||||
namespace GameUI {
|
||||
std::shared_ptr<GameMenuBar> mGameMenuBar;
|
||||
std::shared_ptr<LUS::GuiWindow> mConsoleWindow;
|
||||
std::shared_ptr<LUS::GuiWindow> mStatsWindow;
|
||||
std::shared_ptr<LUS::GuiWindow> mInputEditorWindow;
|
||||
@@ -15,6 +16,8 @@ std::shared_ptr<LUS::GuiWindow> mInputEditorWindow;
|
||||
void SetupGuiElements() {
|
||||
auto gui = LUS::Context::GetInstance()->GetWindow()->GetGui();
|
||||
|
||||
mGameMenuBar = std::make_shared<GameMenuBar>("gOpenMenuBar", CVarGetInteger("gOpenMenuBar", 0));
|
||||
gui->SetMenuBar(mGameMenuBar);
|
||||
mStatsWindow = gui->GetGuiWindow("Stats");
|
||||
if (mStatsWindow == nullptr) {
|
||||
SPDLOG_ERROR("Could not find stats window");
|
||||
@@ -30,7 +33,6 @@ void SetupGuiElements() {
|
||||
SPDLOG_ERROR("Could not find input editor window");
|
||||
return;
|
||||
}
|
||||
mInputEditorWindow->ToggleVisibility();
|
||||
}
|
||||
|
||||
void Destroy() {
|
||||
@@ -38,4 +40,19 @@ void Destroy() {
|
||||
mStatsWindow = nullptr;
|
||||
mInputEditorWindow = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void GameMenuBar::DrawElement() {
|
||||
if(ImGui::BeginMenuBar()){
|
||||
if(ImGui::BeginMenu("Settings")){
|
||||
if (GameUI::mInputEditorWindow) {
|
||||
if (ImGui::Button("Controller Mapping", ImVec2 (-1.0f, 0.0f))) {
|
||||
GameUI::mInputEditorWindow->ToggleVisibility();
|
||||
}
|
||||
}
|
||||
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->DrawSettings();
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
ImGui::EndMenuBar();
|
||||
}
|
||||
}
|
||||
+11
-1
@@ -1,6 +1,16 @@
|
||||
#pragma once
|
||||
#include <libultraship/libultraship.h>
|
||||
|
||||
namespace GameUI {
|
||||
void SetupGuiElements();
|
||||
void Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
class GameMenuBar : public LUS::GuiMenuBar {
|
||||
public:
|
||||
using LUS::GuiMenuBar::GuiMenuBar;
|
||||
protected:
|
||||
void DrawElement() override;
|
||||
void InitElement() override {};
|
||||
void UpdateElement() override {};
|
||||
};
|
||||
Reference in New Issue
Block a user