TWP: Save imgui configuration in savepath

This commit is contained in:
scemino 2024-02-23 22:22:34 +01:00 committed by Eugene Sandulenko
parent ebb5d9c367
commit db26ead64b
3 changed files with 9 additions and 4 deletions

3
.gitignore vendored
View file

@ -299,6 +299,3 @@ dists/emscripten/emsdk-*
#Ignore Atari/FreeMiNT files
scummvm.gtp
scummvm.ttp
#Ignore Dear imgui file
imgui.ini

View file

@ -780,6 +780,11 @@ Common::Error TwpEngine::run() {
ImGui_ImplSDL2_InitForOpenGL(g_window, glContext);
ImGui_ImplOpenGL3_Init("#version 110");
ImGui::StyleColorsDark();
ImGuiIO &io = ImGui::GetIO();
Common::Path initPath(ConfMan.getPath("savepath"));
initPath = initPath.appendComponent("twp_imgui.ini");
io.IniFilename = initPath.toString().c_str();
#endif
// Set the engine's debugger console
@ -835,7 +840,6 @@ Common::Error TwpEngine::run() {
while (g_system->getEventManager()->pollEvent(e)) {
#ifdef USE_IMGUI
ImGui_ImplSDL2_ProcessEvent(&e);
ImGuiIO &io = ImGui::GetIO();
if (io.WantTextInput || io.WantCaptureMouse)
continue;
#endif

4
imgui.ini Normal file
View file

@ -0,0 +1,4 @@
[Window][Debug##Default]
Pos=60,60
Size=400,400