Polyphase Game Engine
Loading...
Searching...
No Matches
ThemeEditorWindow.h
Go to the documentation of this file.
1#pragma once
2
3#if EDITOR
4
5#include "imgui.h"
6#include <string>
7
8class ThemeEditorWindow
9{
10public:
11 ThemeEditorWindow();
12 ~ThemeEditorWindow();
13
14 void Open();
15 void Close();
16 void Draw();
17 void DrawInspectOverlay();
18
19 bool IsOpen() const { return mIsOpen; }
20 bool IsInspectModeActive() const { return mIsOpen && mInspectMode; }
21
22private:
23 void DrawHeader();
24 void DrawColorsTab();
25 void DrawStylePropertiesTab();
26 void DrawFooter();
27
28 // Color category helpers
29 void DrawColorGroup(const char* label, int* colIndices, int count,
30 const char* cssSelector);
31 void DrawPanelColorGroup();
32
33 // Save/Export
34 void DoSave();
35 void DoSaveAs();
36 void DoExportCss();
37
38 // Build CssThemeData from working state for save/export
39 void BuildThemeData();
40
41 bool mIsOpen = false;
42 bool mInspectMode = false;
43
44 // Working copy of style (pushed to ImGui live)
45 ImGuiStyle mWorkingStyle;
46 // Snapshot for revert on cancel
47 ImGuiStyle mBaseStyle;
48
49 // Dock tab text color (not part of ImGuiStyle)
50 ImVec4 mDockTabTextColor = ImVec4(1, 1, 1, 1);
51 bool mHasDockTabTextColor = false;
52
53 // Dock splitter / tab bar overrides
54 ImVec4 mDockSplitterColor = ImVec4(0.3f, 0.3f, 0.3f, 1.0f);
55 bool mHasDockSplitterColor = false;
56 ImVec4 mDockSplitterHoverColor = ImVec4(0.5f, 0.5f, 0.8f, 1.0f);
57 bool mHasDockSplitterHoverColor = false;
58 ImVec4 mDockTabBarBg = ImVec4(0.1f, 0.1f, 0.15f, 1.0f);
59 bool mHasDockTabBarBg = false;
60
61 // Panel background overrides
62 ImVec4 mPanelAssetsBg; bool mHasPanelAssetsBg = false;
63 ImVec4 mPanelSceneBg; bool mHasPanelSceneBg = false;
64 ImVec4 mPanelPropertiesBg; bool mHasPanelPropertiesBg = false;
65 ImVec4 mPanelDebugLogBg; bool mHasPanelDebugLogBg = false;
66
67 // Theme identity
68 char mThemeName[64] = "My Theme";
69 int mBaseThemeIndex = 0; // 0=Dark, 1=Light, 2=FutureDark, 3=Classic
70 int mEditingCustomIndex = -1; // -1 = new theme, >=0 = editing existing
71
72 // Save As popup
73 bool mShowSaveAsPopup = false;
74 char mSaveAsName[64] = {};
75};
76
77ThemeEditorWindow* GetThemeEditorWindow();
78
79#endif