Polyphase Game Engine
Loading...
Searching...
No Matches
ThemeModule.h
Go to the documentation of this file.
1#pragma once
2
3#if EDITOR
4
5#include "../../PreferencesModule.h"
6#include "EditorTheme.h"
7#include <string>
8
9class ThemeModule : public PreferencesModule
10{
11public:
12 DECLARE_PREFERENCES_MODULE(ThemeModule)
13
14 ThemeModule();
15 virtual ~ThemeModule();
16
17 virtual const char* GetName() const override { return GetStaticName(); }
18 virtual const char* GetParentPath() const override { return GetStaticParentPath(); }
19 virtual void Render() override;
20 virtual void LoadSettings(const rapidjson::Document& doc) override;
21 virtual void SaveSettings(rapidjson::Document& doc) override;
22
23 // Settings accessors
24 EditorThemeType GetCurrentTheme() const { return mCurrentTheme; }
25 const std::string& GetCurrentFont() const { return mCurrentFont; }
26 static std::string LoadSavedFontPreference();
27
28 std::string mCurrentFont = "Default";
29
30private:
31 EditorThemeType mCurrentTheme = EditorThemeType::Dark;
32 int mSelectedThemeIndex = 0;
33
34 int mSelectedFontIndex = 0;
35 std::vector<std::string> mAvailableFonts;
36
37 // Custom theme import
38 char mNewThemeName[64] = {};
39 bool mShowImportDialog = false;
40 std::string mPendingImportPath;
41
42 void RefreshAvailableFonts();
43 void LoadFont();
44 static std::string GetSettingsFilePathStatic();
45};
46
47#endif
Definition JsonHelpers.h:15