Пример #1
0
        static void BatchExport()
        {
            _repo = new ExportRepository(Path.Combine(_repoPath, "repo"));

            // Gear
            var badGear = new HashSet <string>(new[]
            {
                "Doman Iron Hatchet", "Doman Iron Pickaxe",
                "Mammon Lucis", "Kurdalegon Lucis", "Rauni Lucis",
                "Kurdalegon Supra", "Rauni Supra",
                "SmallClothes Body", "SmallClothes Feet", "SmallClothes Legs"
            });

            var gearList = _gear.GetGearList()
                           .Where(g => !badGear.Contains(g.Name));

            foreach (var item in gearList)
            {
                var primaryPath = EnsurePath(item.EquipSlotCategory.ToString(), item.ModelInfo);
                BatchExportItem(primaryPath, item, null, () => _gear.GetRacesForModels(item, item.DataFile));

                if (item.SecondaryModelInfo.ModelID != 0)
                {
                    var secondaryPath = EnsurePath(item.EquipSlotCategory.ToString(), item.SecondaryModelInfo);
                    BatchExportItem(secondaryPath, item, item.SecondaryModelInfo, () => _gear.GetRacesForModels(item, item.DataFile));
                }
            }

            // Minions
            var monsters   = new XivRace[] { XivRace.Monster };
            var minionList = _companions.GetMinionList();

            foreach (var minion in minionList)
            {
                var modelKey = $"{minion.ModelInfo.ModelID}-{minion.ModelInfo.Body}-{minion.ModelInfo.Variant}";
                var path     = EnsurePath("minion", modelKey);
                BatchExportItem(path, minion, null, () => monsters);
            }

            // Mounts
            var mountList = _companions.GetMountList();

            foreach (var mount in mountList)
            {
                var modelKey = $"{mount.ModelInfo.ModelID}-{mount.ModelInfo.Body}-{mount.ModelInfo.Variant}";
                var path     = EnsurePath("mount", modelKey);
                BatchExportItem(path, mount, null, () => monsters);
            }
        }
Пример #2
0
        static async Task BatchExport()
        {
            _repo = new ExportRepository(Path.Combine(_repoPath, "repo"));

            // Gear
            WriteLine("Exporting gear...");
            var badGear = new HashSet <string>(new[]
            {
                // ARR
                "SmallClothes Body", "SmallClothes Feet", "SmallClothes Legs",
                "Mammon Lucis", "Kurdalegon Lucis", "Rauni Lucis",
                "Kurdalegon Supra", "Rauni Supra",

                // Stormblood
                "Doman Iron Hatchet", "Doman Iron Pickaxe",

                // Shadowbringers
                "Bluespirit Hatchet", "Weathered Godhands"
            });

            var gearList = (await _gear.GetGearList())
                           .Where(g => !badGear.Contains(g.Name));

            foreach (var item in gearList)
            {
                var primaryPath = EnsurePath(item.EquipSlotCategory.ToString(), item.ModelInfo);
                await BatchExportItem(primaryPath, item, null, () => _gear.GetRacesForModels(item, item.DataFile));

                if (item.SecondaryModelInfo.ModelID != 0)
                {
                    var secondaryPath = EnsurePath(item.EquipSlotCategory.ToString(), item.SecondaryModelInfo);
                    await BatchExportItem(secondaryPath, item, item.SecondaryModelInfo, () => _gear.GetRacesForModels(item, item.DataFile));
                }
            }

            var monsters = new XivRace[] { XivRace.Monster }.ToList();

            // Housing
            WriteLine("Exporting furniture...");
            var furnitureList = await _housing.GetFurnitureList();

            foreach (var furniture in furnitureList)
            {
                var modelKey = $"{furniture.ModelInfo.ModelID}";
                var path     = EnsurePath("furniture", modelKey);

                try
                {
                    await BatchExportItem(path, furniture, null, () => Task.FromResult(monsters));
                }
                catch (Exception ex)
                {
                    WriteLine($"Unable to export {furniture.Name}: {ex.Message}");
                }
            }

            // Mounts
            WriteLine("Exporting mounts...");
            var mountList = await _companions.GetMountList();

            foreach (var mount in mountList)
            {
                var modelKey = $"{mount.ModelInfo.ModelID}-{mount.ModelInfo.Body}-{mount.ModelInfo.Variant}";
                var path     = EnsurePath("mount", modelKey);
                await BatchExportItem(path, mount, null, () => Task.FromResult(monsters));
            }

            // Minions
            WriteLine("Exporting minions...");
            var minionList = await _companions.GetMinionList();

            foreach (var minion in minionList)
            {
                var modelKey = $"{minion.ModelInfo.ModelID}-{minion.ModelInfo.Body}-{minion.ModelInfo.Variant}";
                var path     = EnsurePath("minion", modelKey);
                await BatchExportItem(path, minion, null, () => Task.FromResult(monsters));
            }
        }
Пример #3
0
        static void BatchExport()
        {
            _repo = new ExportRepository(Path.Combine(_repoPath, "repo"));

            // Gear
            var badGear = new HashSet <string>(new[]
            {
                "Doman Iron Hatchet", "Doman Iron Pickaxe",
                "Mammon Lucis", "Kurdalegon Lucis", "Rauni Lucis",
                "Kurdalegon Supra", "Rauni Supra",
                "SmallClothes Body", "SmallClothes Feet", "SmallClothes Legs", "SmallClothes Hands",
                "SmallClothes Body (NPC)", "SmallClothes Feet (NPC)",
                "SmallClothes Feet 2 (NPC)", "SmallClothes Legs (NPC)"
            });

            var gearList = _gear.GetUnCachedGearList().Result.Where(g => !badGear.Contains(g.Name));

            foreach (var item in gearList)
            {
                if (item.Name.StartsWith("Dated"))
                {
                    WriteLine($"Jumped Outdated Item {item.GetType().Name} {item.Name}");
                    continue;
                }

                var primaryPath = EnsurePath(item.EquipSlotCategory.ToString(), item.ModelInfo);

                try
                {
                    BatchExportItem(primaryPath, item, null, () => _gear.GetRacesForModels(item, item.DataFile).Result);
                }
                catch (Exception e)
                {
                    WriteLine($"Failed to export item {item.Name}.");
                }

                // Seconday Model has been deprecated. then just comment here for future changes,

                /*
                 * if (item.ModelInfo.SecondaryID != 0)
                 * {
                 *  var secondaryPath = EnsurePath(item.EquipSlotCategory.ToString(), item.ModelInfo);
                 *  BatchExportItem(secondaryPath, item, item.ModelInfo, () => _gear.GetRacesForModels(item, item.DataFile).Result);
                 * }
                 */
            }

            var monsters = new XivRace[] { XivRace.Monster };

            // Minions
            var minionList = _companions.GetUncachedMinionList().Result;

            foreach (var minion in minionList)
            {
                var modelKey = $"{minion.ModelInfo.PrimaryID}-{minion.ModelInfo.SecondaryID}-{minion.ModelInfo.ImcSubsetID}";
                var path     = EnsurePath("minion", modelKey);
                try
                {
                    BatchExportItem(path, minion, null, () => monsters);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error occured while Exporting " + minion.Name);
                }
            }

            // Mounts
            var mountList = _companions.GetUncachedMountList().Result;

            foreach (var mount in mountList)
            {
                var modelKey = $"{mount.ModelInfo.PrimaryID}-{mount.ModelInfo.SecondaryID}-{mount.ModelInfo.ImcSubsetID}";
                var path     = EnsurePath("mount", modelKey);
                BatchExportItem(path, mount, null, () => monsters);
            }

            /*
             * Housing
             *
             * There is some problem when exporting furniture with xivModdingFramework.
             * see https://github.com/TexTools/xivModdingFramework/issues/37 for more detail.
             * comment this section if you don't want half-completed things being exported.
             * if you want redo this, then remove the gtfiles/model/furnture folder and rerun this.
             */
            /*
             * var furnitureList = _housing.GetUncachedFurnitureList().Result;
             * foreach (var furniture in furnitureList)
             * {
             *  var modelKey = $"{furniture.ModelInfo.PrimaryID}";
             *  var path = EnsurePath("furniture", modelKey);
             *
             *  try
             *  {
             *      BatchExportItem(path, furniture, null, () => monsters);
             *  }
             *  catch (Exception ex)
             *  {
             *      WriteLine($"Unable to export {furniture.Name}: {ex.Message}");
             *  }
             * }
             */
        }