feat: support resources cache

This commit is contained in:
letheriver2007
2024-12-22 21:02:26 +08:00
committed by EggLink
parent f65c2933a5
commit 6484e28df8
20 changed files with 348 additions and 60 deletions

View File

@@ -23,6 +23,16 @@ public static class HandbookGenerator
{
if (langFile.Extension != ".json") return;
var lang = langFile.Name.Replace("TextMap", "").Replace(".json", "");
// Check if handbook needs to regenerate
var handbookPath = $"GM Handbook/GM Handbook {lang}.txt";
if (File.Exists(handbookPath))
{
var handbookInfo = new FileInfo(handbookPath);
if (handbookInfo.LastWriteTime >= langFile.LastWriteTime)
continue; // Skip if handbook is newer than language file
}
Generate(lang);
}