private void getObjFilesBtn_Click(object sender, RoutedEventArgs e) { StringBuilder sb = new StringBuilder(mapPath); sb.Append(territoryName + @"\"); sb.Append(@"objects\"); String pathToSave = sb.ToString(); if (!Directory.Exists(pathToSave)) { Directory.CreateDirectory(pathToSave); } String[] list = box.Text.Split('\n'); foreach (String line in list) { if (!String.IsNullOrEmpty(line)) { ModelFile file = (ModelFile)realm.Packs.GetFile(line.Trim()); ObjectFileWriter.WriteObjectFile(pathToSave, file); } } }
public static void WriteOutHousingExteriorModels(ARealmReversed realm) { string inpath = FFXIVHSPaths.GetHousingExteriorJson(); if (!File.Exists(inpath)) { throw new FileNotFoundException(); } string outpath = FFXIVHSPaths.GetHousingExteriorObjectsDirectory(); string jsonText = File.ReadAllText(inpath); Dictionary <int, HousingExteriorFixture> fixtures = JsonConvert.DeserializeObject <Dictionary <int, HousingExteriorFixture> >(jsonText); foreach (HousingExteriorFixture fixture in fixtures.Values) { foreach (HousingExteriorFixtureVariant variant in fixture.variants) { foreach (HousingExteriorFixtureModel model in variant.models) { if (realm.Packs.TryGetFile(model.modelPath, out SaintCoinach.IO.File f)) { ObjectFileWriter.WriteObjectFile(outpath, (ModelFile)f); } } } } }
public static void WriteMapModels(ARealmReversed realm, TerritoryType teriType, SaintCoinach.Graphics.Territory teri = null) { string name = teri != null ? teri.Name : teriType.Name; //Plot.Ward ward = Plot.StringToWard(teriType.Name); string outpath = Path.Combine(FFXIVHSPaths.GetRootDirectory(), name, "objects\\"); string inpath = Path.Combine(FFXIVHSPaths.GetRootDirectory(), name + "\\", name + ".json"); if (!Directory.Exists(outpath)) { Directory.CreateDirectory(outpath); } //string inpath = FFXIVHSPaths.GetWardJson(ward); if (!File.Exists(inpath)) { throw new FileNotFoundException(); } //string outpath = FFXIVHSPaths.GetWardObjectsDirectory(ward); 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); } } }
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); } } }