Called by NewFrame()
| 11484 | |
| 11485 | // Called by NewFrame() |
| 11486 | void ImGui::UpdateSettings() |
| 11487 | { |
| 11488 | // Load settings on first frame (if not explicitly loaded manually before) |
| 11489 | ImGuiContext& g = *GImGui; |
| 11490 | if (!g.SettingsLoaded) |
| 11491 | { |
| 11492 | IM_ASSERT(g.SettingsWindows.empty()); |
| 11493 | if (g.IO.IniFilename) |
| 11494 | LoadIniSettingsFromDisk(g.IO.IniFilename); |
| 11495 | g.SettingsLoaded = true; |
| 11496 | } |
| 11497 | |
| 11498 | // Save settings (with a delay after the last modification, so we don't spam disk too much) |
| 11499 | if (g.SettingsDirtyTimer > 0.0f) |
| 11500 | { |
| 11501 | g.SettingsDirtyTimer -= g.IO.DeltaTime; |
| 11502 | if (g.SettingsDirtyTimer <= 0.0f) |
| 11503 | { |
| 11504 | if (g.IO.IniFilename != NULL) |
| 11505 | SaveIniSettingsToDisk(g.IO.IniFilename); |
| 11506 | else |
| 11507 | g.IO.WantSaveIniSettings = true; // Let user know they can call SaveIniSettingsToMemory(). user will need to clear io.WantSaveIniSettings themselves. |
| 11508 | g.SettingsDirtyTimer = 0.0f; |
| 11509 | } |
| 11510 | } |
| 11511 | } |
| 11512 | |
| 11513 | void ImGui::MarkIniSettingsDirty() |
| 11514 | { |