From 2eca9cc56a5088090d63e800a14687209bb9c34d Mon Sep 17 00:00:00 2001 From: Louis <35883445+louist103@users.noreply.github.com> Date: Fri, 21 Jun 2024 20:07:26 -0400 Subject: [PATCH] Some fixes and improvements --- src/window/gui/Gui.cpp | 4 ++++ src/window/gui/Gui.h | 1 + src/window/gui/GuiWindow.h | 1 + 3 files changed, 6 insertions(+) diff --git a/src/window/gui/Gui.cpp b/src/window/gui/Gui.cpp index 480320d9d..c1fb50e7b 100644 --- a/src/window/gui/Gui.cpp +++ b/src/window/gui/Gui.cpp @@ -723,6 +723,10 @@ void Gui::RemoveGuiWindow(const std::string& name) { mGuiWindows.erase(name); } +void Ship::Gui::RemoveAllGuiWindows() { + mGuiWindows.clear(); +} + std::shared_ptr Gui::GetGuiWindow(const std::string& name) { if (mGuiWindows.contains(name)) { return mGuiWindows[name]; diff --git a/src/window/gui/Gui.h b/src/window/gui/Gui.h index 1453b3ca1..39388af3e 100644 --- a/src/window/gui/Gui.h +++ b/src/window/gui/Gui.h @@ -82,6 +82,7 @@ class Gui { void AddGuiWindow(std::shared_ptr guiWindow); void RemoveGuiWindow(std::shared_ptr guiWindow); void RemoveGuiWindow(const std::string& name); + void RemoveAllGuiWindows(); void LoadGuiTexture(const std::string& name, const std::string& path, const ImVec4& tint); bool HasTextureByName(const std::string& name); void LoadGuiTexture(const std::string& name, const LUS::Texture& tex, const ImVec4& tint); diff --git a/src/window/gui/GuiWindow.h b/src/window/gui/GuiWindow.h index e669643d5..539d3529a 100644 --- a/src/window/gui/GuiWindow.h +++ b/src/window/gui/GuiWindow.h @@ -11,6 +11,7 @@ namespace Ship { class GuiWindow : public GuiElement { public: + GuiWindow() = default; GuiWindow(const std::string& consoleVariable, bool isVisible, const std::string& name); GuiWindow(const std::string& consoleVariable, const std::string& name);