From b7bc19cf9d53550e7280eb476afe5f16a5b10c9d Mon Sep 17 00:00:00 2001 From: MegaMech Date: Tue, 10 Sep 2024 16:31:42 -0600 Subject: [PATCH] Update ImguiUI.cpp (#69) --- src/port/ui/ImguiUI.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index 01a1e1540..a6c65259e 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -2,6 +2,7 @@ #include "UIWidgets.h" #include "ResolutionEditor.h" #include "GameInfoWindow.h" +#include "MultiplayerWindow.h" #include "FreecamWindow.h" #include @@ -23,6 +24,7 @@ std::shared_ptr mStatsWindow; std::shared_ptr mInputEditorWindow; std::shared_ptr mGfxDebuggerWindow; std::shared_ptr mGameInfoWindow; +std::shared_ptr mMultiplayerWindow; std::shared_ptr mFreecamWindow; std::shared_ptr mAdvancedResolutionSettingsWindow; @@ -37,6 +39,11 @@ void SetupGuiElements() { mGameMenuBar = std::make_shared("gOpenMenuBar", CVarGetInteger("gOpenMenuBar", 0)); gui->SetMenuBar(mGameMenuBar); + mMultiplayerWindow = gui->GetGuiWindow("Multiplayer"); + if (mMultiplayerWindow == nullptr) { + SPDLOG_ERROR("Could not find multiplayer window"); + } + mGameInfoWindow = gui->GetGuiWindow("GameInfo"); if (mGameInfoWindow == nullptr) { SPDLOG_ERROR("Could not find game info window"); @@ -63,6 +70,9 @@ void SetupGuiElements() { SPDLOG_ERROR("Could not find input GfxDebuggerWindow"); } + mMultiplayerWindow = std::make_shared("gMultiplayerWindowEnabled", "Multiplayer"); + gui->AddGuiWindow(mMultiplayerWindow); + mFreecamWindow = gui->GetGuiWindow("FreecamWindow"); if (mFreecamWindow == nullptr) { SPDLOG_ERROR("Could not find input FreecamWindow"); @@ -455,6 +465,10 @@ void DrawGameMenu() { void DrawEnhancementsMenu() { if (UIWidgets::BeginMenu("Enhancements")) { + UIWidgets::WindowButton("Multiplayer", "gMultiplayerWindowEnabled", GameUI::mMultiplayerWindow, + { .tooltip = "Shows the multiplayer window" }); + + if (UIWidgets::BeginMenu("Gameplay")) { UIWidgets::CVarCheckbox("No Level of Detail (LOD)", "gDisableLOD", { .tooltip = "Disable Level of Detail (LOD) to avoid models using "