12
12
13
13
#define CHECK_MODULE_ENABLED (x ) if (mod[#x]) \
14
14
{ \
15
- Modules::data () .x = mod[#x].as <bool >(); \
15
+ settings .x = mod[#x].as <bool >(); \
16
16
}
17
17
18
18
#include < Utilities.hpp>
@@ -107,27 +107,27 @@ void UImGui::ModulesManager::initModules(const FString& projectDir)
107
107
CHECK_MODULE_ENABLED (cli_parser);
108
108
CHECK_MODULE_ENABLED (xdg);
109
109
CHECK_MODULE_ENABLED (open );
110
-
110
+
111
111
// Fix up double forms
112
112
if (mod[" undo-redo" ])
113
- Modules::data () .undo_redo = mod[" undo-redo" ].as <bool >();
113
+ settings .undo_redo = mod[" undo-redo" ].as <bool >();
114
114
if (mod[" text-utils" ])
115
- Modules::data () .text_utils = mod[" text-utils" ].as <bool >();
115
+ settings .text_utils = mod[" text-utils" ].as <bool >();
116
116
if (mod[" cli-parser" ])
117
- Modules::data () .cli_parser = mod[" cli-parser" ].as <bool >();
117
+ settings .cli_parser = mod[" cli-parser" ].as <bool >();
118
118
119
119
#ifdef UIMGUI_UNDO_MODULE_ENABLED
120
- if (Modules::data () .undo_redo )
120
+ if (settings .undo_redo )
121
121
stateTracker.init ();
122
122
#endif
123
123
#ifdef UIMGUI_I18N_MODULE_ENABLED
124
- if (Modules::data () .i18n )
124
+ if (settings .i18n )
125
125
if (const auto result = translationEngine.init ((Instance::get ()->initInfo .configDir + " Translations" ).c_str ()) != UI18N_INIT_RESULT_SUCCESS)
126
126
Logger::log (" I18N module: There was an issue with loading or processing the translations. Error code: " , ULOG_LOG_TYPE_WARNING, CAST (int , result));
127
127
#endif
128
128
#ifdef UIMGUI_OS_MODULE_ENABLED
129
129
#ifdef UIMGUI_OPEN_SUBMODULE_ENABLED
130
- if (Modules::data () .open )
130
+ if (settings .open )
131
131
UOpen::init ();
132
132
#endif
133
133
#endif
@@ -145,11 +145,27 @@ void UImGui::ModulesManager::initModules(const FString& projectDir)
145
145
#endif
146
146
}
147
147
148
- void UImGui::ModulesManager::destroy () noexcept
148
+ void UImGui::ModulesManager::initialiseWithImGuiContext () const noexcept
149
+ {
150
+ #ifdef UIMGUI_PLOTTING_MODULE_ENABLED
151
+ if (settings.plotting )
152
+ ImPlot::CreateContext ();
153
+ #endif
154
+ }
155
+
156
+ void UImGui::ModulesManager::applyCustomisations () const noexcept
157
+ {
158
+ #ifdef UIMGUI_THEME_MODULE_ENABLED
159
+ if (settings.theming && (Modules::data ().themeLocation != nullptr || Modules::data ().themeLocation != " " ))
160
+ Theme::load ((Instance::get ()->initInfo .configDir + " Theme/" + Modules::data ().themeLocation + " .theme.yaml" ).c_str ());
161
+ #endif
162
+ }
163
+
164
+ void UImGui::ModulesManager::destroy () const noexcept
149
165
{
150
166
#ifdef UIMGUI_OS_MODULE_ENABLED
151
167
#ifdef UIMGUI_OPEN_SUBMODULE_ENABLED
152
- if (Modules::data () .open )
168
+ if (settings .open )
153
169
UOpen::destroy ();
154
170
#endif
155
171
#endif
0 commit comments