Separated tile file loading from StaticTiles constructor

master
Katie Durden 2023-03-08 20:04:23 -08:00
parent dd812851b4
commit 5d8f85fa5b
1 changed files with 6 additions and 2 deletions

View File

@ -16,6 +16,12 @@ namespace stardew_access.Features
if (MainClass.ModHelper is null)
return;
if (staticTilesData is null) LoadTilesFiles();
this.SetupTilesDicts();
}
public static void LoadTilesFiles()
{
try
{
using (StreamReader file = new(Path.Combine(MainClass.ModHelper.DirectoryPath, "assets", "static-tiles.json")))
@ -51,9 +57,7 @@ namespace stardew_access.Features
{
MainClass.InfoLog($"custom-tiles.json file not found or an error occured while initializing custom-tiles.json\nThe path of the file should be:\n\t{Path.Combine(MainClass.ModHelper.DirectoryPath, "assets", "custom-tiles.json")}");
}
this.SetupTilesDicts();
}
public static bool IsAvailable(string locationName)
{
List<JObject> allData = new();