public static void WriteMapModels(ARealmReversed realm, TerritoryType teriType) { Territory territory = Plot.StringToWard(teriType.Name); string inpath = FFXIVHSPaths.GetTerritoryJson(territory); if (!File.Exists(inpath)) { throw new FileNotFoundException(); } string outpath = FFXIVHSPaths.GetTerritoryObjectsDirectory(territory); string json = File.ReadAllText(inpath); Map map = JsonConvert.DeserializeObject <Map>(json); foreach (MapModel model in map.models.Values) { if (realm.Packs.TryGetFile(model.modelPath, out SaintCoinach.IO.File f)) { ObjectFileWriter.WriteObjectFile(outpath, (ModelFile)f); } } }
private static void LoadMapTerrainInfo() { string jsonText = File.ReadAllText(FFXIVHSPaths.GetTerritoryJson(territory)); _map = JsonConvert.DeserializeObject <Map>(jsonText); Debug.Log("_map loaded."); }
public static void WriteMap(ARealmReversed realm, TerritoryType teriType) { Territory territory = Plot.StringToWard(teriType.Name); string outpath = FFXIVHSPaths.GetTerritoryJson(territory); if (File.Exists(outpath)) { WriteMapModels(realm, teriType); return; } Map map = ReadTerritory(teriType); string json = JsonConvert.SerializeObject(map, Formatting.Indented); File.WriteAllText(outpath, json); }