mirror of
https://github.com/ocornut/imgui.git
synced 2026-09-28 04:03:28 +03:00
Settings: added a type name filter to CleanupIniSettings() / ImGuiSettingsCleanupArgs. (#9460)
This commit is contained in:
parent
85593d0869
commit
2c49da44be
2 changed files with 5 additions and 2 deletions
|
|
@ -15713,12 +15713,14 @@ void ImGui::CleanupIniSettings(ImGuiSettingsCleanupArgs* args)
|
|||
ImGuiContext& g = *GImGui;
|
||||
if (g.PlatformIO.Platform_SessionDate == 0)
|
||||
return;
|
||||
ImGuiID type_hash_filter = args->TypeName ? ImHashStr(args->TypeName) : 0;
|
||||
ImGuiPackedDate discard_older_than_date_p = g.PlatformIO.Platform_SessionDate;
|
||||
discard_older_than_date_p.SubtractMonths(args->DiscardOlderThanMonths);
|
||||
args->_DiscardOlderThanDate = discard_older_than_date_p.Unpack();
|
||||
for (ImGuiSettingsHandler& handler : g.SettingsHandlers)
|
||||
if (handler.CleanupFn != NULL)
|
||||
handler.CleanupFn(&g, &handler, args);
|
||||
if (type_hash_filter == 0 || handler.TypeHash == type_hash_filter)
|
||||
if (handler.CleanupFn != NULL)
|
||||
handler.CleanupFn(&g, &handler, args);
|
||||
}
|
||||
|
||||
void ImGui::LoadIniSettingsFromDisk(const char* ini_filename)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue