Esempio n. 1
0
        public static void OutputWorld(World ck3World, IEnumerable <Mod> imperatorMods, Configuration config)
        {
            ClearOutputModFolder();

            var outputName = config.OutputModName;

            CreateModFolder(outputName);
            OutputModFile(outputName);

            Logger.Info("Creating folders...");
            CreateFolders(outputName);

            Logger.Info("Writing Characters...");
            CharactersOutputter.OutputCharacters(outputName, ck3World.Characters, ck3World.CorrectedDate);

            Logger.Info("Writing Dynasties...");
            DynastiesOutputter.OutputDynasties(outputName, ck3World.Dynasties);

            Logger.Info("Writing Provinces...");
            ProvincesOutputter.OutputProvinces(outputName, ck3World.Provinces, ck3World.LandedTitles);

            Logger.Info("Writing Landed Titles...");
            TitlesOutputter.OutputTitles(
                outputName,
                ck3World.LandedTitles,
                config.ImperatorDeJure
                );

            Logger.Info("Writing Succession Triggers...");
            SuccessionTriggersOutputter.OutputSuccessionTriggers(outputName, ck3World.LandedTitles, config.CK3BookmarkDate);

            Logger.Info("Writing Localization...");
            LocalizationOutputter.OutputLocalization(
                config.ImperatorPath,
                outputName,
                ck3World,
                config.ImperatorDeJure
                );

            var outputPath = Path.Combine("output", config.OutputModName);

            Logger.Info("Copying named colors...");
            SystemUtils.TryCopyFile(
                Path.Combine(config.ImperatorPath, "game", "common", "named_colors", "default_colors.txt"),
                Path.Combine(outputPath, "common", "named_colors", "imp_colors.txt")
                );

            Logger.Info("Copying Coats of Arms...");
            ColoredEmblemsOutputter.CopyColoredEmblems(config, imperatorMods);
            CoatOfArmsOutputter.OutputCoas(outputName, ck3World.LandedTitles);
            SystemUtils.TryCopyFolder(
                Path.Combine(config.ImperatorPath, "game", "gfx", "coat_of_arms", "patterns"),
                Path.Combine(outputPath, "gfx", "coat_of_arms", "patterns")
                );

            Logger.Info("Copying blankMod files to output...");
            SystemUtils.TryCopyFolder(
                Path.Combine("blankMod", "output"),
                outputPath
                );

            Logger.Info("Creating bookmark...");
            BookmarkOutputter.OutputBookmark(ck3World, config);

            void ClearOutputModFolder()
            {
                var directoryToClear = $"output/{config.OutputModName}";
                var di = new DirectoryInfo(directoryToClear);

                if (!di.Exists)
                {
                    return;
                }

                Logger.Info("Clearing the output mod folder...");
                foreach (FileInfo file in di.EnumerateFiles())
                {
                    file.Delete();
                }
                foreach (DirectoryInfo dir in di.EnumerateDirectories())
                {
                    dir.Delete(true);
                }
            }
        }
Esempio n. 2
0
        public static void OutputWorld(World ck3World, Configuration theConfiguration)
        {
            var directoryToClear = "output/" + theConfiguration.OutputModName;
            var di = new DirectoryInfo(directoryToClear);

            if (di.Exists)
            {
                Logger.Info("Clearing the output mod folder.");
                foreach (FileInfo file in di.EnumerateFiles())
                {
                    file.Delete();
                }
                foreach (DirectoryInfo dir in di.EnumerateDirectories())
                {
                    dir.Delete(true);
                }
            }

            var outputName = theConfiguration.OutputModName;

            CreateModFolder(outputName);
            OutputModFile(outputName);

            Logger.Info("Creating folders.");
            CreateFolders(outputName);

            Logger.Info("Writing Characters.");
            CharactersOutputter.OutputCharacters(outputName, ck3World.Characters, theConfiguration.Ck3BookmarkDate);

            Logger.Info("Writing Dynasties.");
            DynastiesOutputter.OutputDynasties(outputName, ck3World.Dynasties);

            Logger.Info("Writing Provinces.");
            ProvincesOutputter.OutputProvinces(outputName, ck3World.Provinces, ck3World.LandedTitles);

            Logger.Info("Writing Landed Titles.");
            TitlesOutputter.OutputTitles(
                outputName,
                theConfiguration.Ck3Path,
                ck3World.LandedTitles,
                theConfiguration.ImperatorDeJure,
                theConfiguration.Ck3BookmarkDate
                );

            Logger.Info("Writing Localization.");
            LocalizationOutputter.OutputLocalization(
                theConfiguration.ImperatorPath,
                outputName,
                ck3World,
                theConfiguration.ImperatorDeJure
                );

            var outputPath = "output/" + theConfiguration.OutputModName;

            Logger.Info("Copying named colors.");
            SystemUtils.TryCopyFile(theConfiguration.ImperatorPath + "/game/common/named_colors/default_colors.txt",
                                    outputPath + "/common/named_colors/imp_colors.txt");

            Logger.Info("Copying Coats of Arms.");
            ColoredEmblemsOutputter.CopyColoredEmblems(theConfiguration, outputName);
            CoatOfArmsOutputter.OutputCoas(outputName, ck3World.LandedTitles);
            SystemUtils.TryCopyFolder(theConfiguration.ImperatorPath + "/game/gfx/coat_of_arms/patterns",
                                      outputPath + "/gfx/coat_of_arms/patterns");

            Logger.Info("Copying blankMod files to output.");
            SystemUtils.TryCopyFolder("blankMod/output", outputPath);

            Logger.Info("Creating bookmark.");
            BookmarkOutputter.OutputBookmark(
                outputName,
                ck3World.Characters,
                ck3World.LandedTitles,
                theConfiguration.Ck3BookmarkDate
                );
        }