Add Weather Page

This commit is contained in:
2023-10-14 11:36:17 +08:00
parent cfdca6f031
commit f8b920100d
18 changed files with 2199 additions and 566 deletions

View File

@@ -69,6 +69,8 @@ namespace GrasscutterTools.Game.Data
public TextMapData TextMapData { get; set; }
public List<WeatherData> WeatherData { get; set; }
public GameResources(string resourcesDirPath, TextMapData textMapData)
{
TextMapData = textMapData;
@@ -446,6 +448,31 @@ namespace GrasscutterTools.Game.Data
#endregion
#region Weather
// Weather
sb.Clear();
foreach (var scene in WeatherData
.GroupBy(it => it.SceneId)
.OrderBy(it => it.Key))
{
sb.Append("// ").AppendLine(scene.Key.ToString());
foreach (var weather in scene)
{
var profileName = weather.ProfileName.Substring(weather.ProfileName.LastIndexOf('/') + 1)
.Replace("ESP_", "");
sb.AppendLine($"{weather.AreaId}:{profileName}");
}
}
File.WriteAllText(
Path.Combine(projectResourcesDir, "Weather.txt"),
sb.ToString(),
Encoding.UTF8);
#endregion
File.WriteAllLines(
Path.Combine(projectResourcesDir, "AvatarColor.txt"),
AvatarData.Values.Select(it => $"{it.Id % 1000 + 1000}:{(int)it.QualityType}"),