Fix Language Change And Name Collision In Presets

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
copeconeandClaude Sonnet 5.5 committed 2026-10-14 20:20:06 +09:00
1 parent 27e7327c1e
commit 22bd38d008
2 files changed
+31 -7

No files matched your search

+5 -1
View File
@@ -116,7 +116,11 @@ public static class PresetManager
return Path.Combine(root, "UserData", "ADOFAIRenderer", "Presets");
}
private static string GetSafeFileName(string name)
/// <summary>
/// File name (without extension) of the preset file for the given preset name: every character that is invalid
/// in a file name is replaced with '_'. Different preset names can map to the same file name (e.g. "a/b" and "a_b").
/// </summary>
internal static string GetSafeFileName(string name)
{
return Path.GetInvalidFileNameChars().Aggregate(name, (current, c) => current.Replace(c, '_'));
}