6#include "../third_party/imgui/imgui.h"
7#include "../third_party/imgui/imgui_internal.h"
8#include "../third_party/imnodes/imnodes.h"
26 std::ifstream
file(filepath);
29 std::cout <<
"[EditorConfigManager] Config file not found, using defaults: " << filepath << std::endl;
38 if (
j.contains(
"panelVisibility"))
40 auto&
pv =
j[
"panelVisibility"];
49 if (
j.contains(
"preferences"))
51 auto&
prefs =
j[
"preferences"];
60 if (
j.contains(
"imguiSettings") &&
j[
"imguiSettings"].contains(
"windows"))
67 std::string
key =
it.key();
71 config.
x = value.value(
"x", 0.0f);
72 config.y = value.value(
"y", 0.0f);
73 config.width = value.value(
"width", 800.0f);
74 config.height = value.value(
"height", 600.0f);
75 config.collapsed = value.value(
"collapsed",
false);
81 std::cout <<
"[EditorConfigManager] Configuration loaded from: " << filepath << std::endl;
84 catch (
const std::exception&
e)
86 std::cerr <<
"[EditorConfigManager] Failed to load config: " <<
e.what() << std::endl;
98 j[
"panelVisibility"] = {
120 const std::string& name =
it->first;
135 std::ofstream
file(filepath);
138 std::cerr <<
"[EditorConfigManager] Failed to open config file for writing: " << filepath << std::endl;
145 std::cout <<
"[EditorConfigManager] Configuration saved to: " << filepath << std::endl;
148 catch (
const std::exception&
e)
150 std::cerr <<
"[EditorConfigManager] Failed to save config: " <<
e.what() << std::endl;
195 for (
int i = 0;
i < context->Windows.Size;
i++)
ComponentTypeID GetComponentTypeID_Static()
static SDL_Window * window
void SaveWindowConfig(const std::string &windowName, const WindowConfig &config)
ImGuiSettings m_ImGuiSettings
bool LoadConfig(const std::string &filepath)
bool SaveConfig(const std::string &filepath)
static EditorConfigManager & Get()
EditorPreferences m_Preferences
WindowConfig GetWindowConfig(const std::string &windowName) const
PanelVisibility m_PanelVisibility
< Provides AssetID and INVALID_ASSET_ID
int autoSaveIntervalSeconds
std::map< std::string, WindowConfig > windowConfigs