Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
EditorConfigManager.h
Go to the documentation of this file.
1/*
2 * Olympe Blueprint Editor - Configuration Manager
3 *
4 * Manages editor configuration through JSON file instead of imgui.ini
5 * Handles loading and saving of:
6 * - Window positions and sizes
7 * - Panel visibility states
8 * - Editor preferences
9 * - ImGui and ImNodes settings
10 */
11
12#pragma once
13
14#include "../third_party/nlohmann/json.hpp"
15#include <string>
16#include <map>
17
18namespace Olympe
19{
21 {
22 float x = 0.0f;
23 float y = 0.0f;
24 float width = 800.0f;
25 float height = 600.0f;
26 bool collapsed = false;
27 };
28
30 {
31 bool showAssetBrowser = true;
32 bool showInspector = true;
33 bool showNodeGraph = true;
34 bool showTemplateBrowser = false;
35 bool showHistory = false;
36 };
37
39 {
40 bool gridLinesEnabled = true;
41 bool autoSaveEnabled = true;
43 float panningSpeed = 1.0f;
44 float zoomSpeed = 0.1f;
45 };
46
48 {
49 // Store ImGui window settings as key-value pairs
50 std::map<std::string, WindowConfig> windowConfigs;
51 };
52
54 {
55 public:
56 static EditorConfigManager& Get();
57
58 // Load configuration from JSON file
59 bool LoadConfig(const std::string& filepath);
60
61 // Save configuration to JSON file
62 bool SaveConfig(const std::string& filepath);
63
64 // Getters
68
69 // Setters
72
73 // ImGui window state management
74 void SaveWindowConfig(const std::string& windowName, const WindowConfig& config);
75 WindowConfig GetWindowConfig(const std::string& windowName) const;
76
77 // Apply settings to ImGui/ImNodes
78 void ApplyToImGui();
79
80 // Capture current ImGui state
81 void CaptureFromImGui();
82
83 private:
86
89
93
94 // Default config file path
95 static constexpr const char* DEFAULT_CONFIG_PATH = "./config/ATS-VS-editor-config.json";
96 };
97}
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
void SetPanelVisibility(const PanelVisibility &visibility)
void SetPreferences(const EditorPreferences &prefs)
EditorConfigManager & operator=(const EditorConfigManager &)=delete
const PanelVisibility & GetPanelVisibility() const
void SaveWindowConfig(const std::string &windowName, const WindowConfig &config)
static constexpr const char * DEFAULT_CONFIG_PATH
const ImGuiSettings & GetImGuiSettings() const
bool LoadConfig(const std::string &filepath)
bool SaveConfig(const std::string &filepath)
const EditorPreferences & GetPreferences() const
static EditorConfigManager & Get()
WindowConfig GetWindowConfig(const std::string &windowName) const
EditorConfigManager(const EditorConfigManager &)=delete
< Provides AssetID and INVALID_ASSET_ID
std::map< std::string, WindowConfig > windowConfigs