Update Tools page

This commit is contained in:
2023-06-09 22:42:33 +08:00
parent 6706525e77
commit c1b89a2b9a
10 changed files with 219 additions and 5 deletions

View File

@@ -17,6 +17,7 @@
*
**/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -31,9 +32,12 @@ namespace GrasscutterTools.Game
{
LoadManualTextMap(Path.Combine(resourcesDirPath, "ExcelBinOutput", "ManualTextMapConfigData.json"));
LoadTextMaps(Path.Combine(resourcesDirPath, "TextMap"));
LoadTextMap(TextMapFilePaths[Array.IndexOf(TextMapFiles, "TextMapCHS")]);
DefaultTextMap = TextMap;
}
public Dictionary<string, string> ManualTextMap;
public Dictionary<string, string> DefaultTextMap;
public Dictionary<string, string> TextMap;
public string[] TextMapFilePaths;
public string[] TextMapFiles;
@@ -81,5 +85,12 @@ namespace GrasscutterTools.Game
}
}
}
public string GetText(string textMapHash)
{
return TextMap.TryGetValue(textMapHash, out var text) ? text
: DefaultTextMap.TryGetValue(textMapHash, out text) ? text
: "???";
}
}
}