diff --git a/CMakeLists.txt b/CMakeLists.txt index f683da0c..2064eeaa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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($<$:/MP>) add_compile_options($<$:/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/") diff --git a/libultraship b/libultraship index 9c54a920..2a1ce000 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 9c54a9200ab2d1bb2f20a4e0dc8c33be9f71542d +Subproject commit 2a1ce0001df7383e87f364e89b33358b9e294ab3 diff --git a/src/port/ImguiUI.cpp b/src/port/ImguiUI.cpp index e3648552..66bb8a8e 100644 --- a/src/port/ImguiUI.cpp +++ b/src/port/ImguiUI.cpp @@ -8,6 +8,7 @@ #include namespace GameUI { +std::shared_ptr mGameMenuBar; std::shared_ptr mConsoleWindow; std::shared_ptr mStatsWindow; std::shared_ptr mInputEditorWindow; @@ -15,6 +16,8 @@ std::shared_ptr mInputEditorWindow; void SetupGuiElements() { auto gui = LUS::Context::GetInstance()->GetWindow()->GetGui(); + mGameMenuBar = std::make_shared("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(); + } } \ No newline at end of file diff --git a/src/port/ImguiUI.h b/src/port/ImguiUI.h index 2fe57099..2d233f4c 100644 --- a/src/port/ImguiUI.h +++ b/src/port/ImguiUI.h @@ -1,6 +1,16 @@ #pragma once +#include namespace GameUI { void SetupGuiElements(); void Destroy(); -} \ No newline at end of file +} + +class GameMenuBar : public LUS::GuiMenuBar { + public: + using LUS::GuiMenuBar::GuiMenuBar; + protected: + void DrawElement() override; + void InitElement() override {}; + void UpdateElement() override {}; +}; \ No newline at end of file