text: #pragma once
  #include "common/Typedefs.h"
  #include "common/String.h"
  #include "common/Handle.h"
  #include "GuiState.h"
  #include "MenuItem.h"
  #include "application/mods/ModManager.h"
  #include <vector>
  #include <mutex>
  
  class ImGuiFontManager;
  class DX11Renderer;
  class Config;
  class IGuiPanel;
  using ImGuiID = unsigned int;
  
  //Todo: Split the gui out into multiple files and/or classes. Will be a mess if it's all in one file
  class MainGui
  {
  public:
      void Init(ImGuiFontManager* fontManager, DX11Renderer* renderer, ModManager* modManager);
      void Update();
  
      GuiState State; //Global gui state provided to each panel and document
      f32 mainMenuHeight = 8.0f;
      f32 toolbarHeight = 16.0f;
      bool Shutdown = false;
  
  private:
      void AddMenuItem(std::string_view menuPos, bool open, Handle<IGuiPanel> panel);
      void DrawMainMenuBar();
      void DrawDockspace();
      void GenerateMenus();
      MenuItem* GetMenu(std::string_view text);
      void SetPanelVisibility(const std::string& title, bool visible);
  
      std::vector<Handle<IGuiPanel>> panels_ = {};
      std::vector<MenuItem> menuItems_ = {}; //Main menu bar items
      ImGuiID dockspaceId = 0;
      ImGuiID dockspaceCentralNodeId = 0;
      bool showModPackagingPopup_ = false;
      bool showNewProjectWindow_ = false;
      bool showOpenProjectWindow_ = false;
      bool showSaveProjectWindow_ = false;
      bool showSettingsWindow_ = false;
      bool showTextureSearchGenPopup_ = false;
      bool openProjectRequested_ = false;
      bool closeProjectRequested_ = false;
      bool openRecentProjectRequested_ = false;
      bool imguiDemoWindowOpen_ = true;
      string openRecentProjectRequestData_;
      Handle<IDocument> currentDocument_ = nullptr;
  };