Exemplo n.º 1
0
        public static void Gen_DefsTemplate(string defsPath, string outputPath)
        {
            if (!Directory.Exists(defsPath))
            {
                Log.Error();
                Log.WriteLine($"Directory no found: {defsPath}");
                return;
            }

            string sourceCodePath = Path.Combine(Directory.GetCurrentDirectory(), "Assembly-CSharp");

            if (Directory.Exists(sourceCodePath))
            {
                Log.Info();
                Log.WriteLine();
            }
            else
            {
                sourceCodePath = null;
            }

            DefinitionData coreDefinitionData = DefinitionData.Load(defsPath);

            Capture capture = Capture.Parse(coreDefinitionData);

            capture.ProcessFieldNames(coreDefinitionData);
            coreDefinitionData.Save(Path.Combine(outputPath, "CoreDefsProcessed"));

            Capture templates = Capture.Parse(coreDefinitionData, sourceCodePath, true);

            templates.Save(Path.Combine(outputPath, "Templates"));
        }
Exemplo n.º 2
0
        public static void Gen_DefsTemplate()
        {
            DefinitionData coreDefinitionData = DefinitionData.Load(@"D:\Games\SteamLibrary\steamapps\common\RimWorld\Mods\Core\Defs");

            Capture capture = Capture.Parse(coreDefinitionData);

            capture.ProcessFieldNames(coreDefinitionData);
            coreDefinitionData.Save(@"C:\git\rw\RimWorld-Defs-Templates\CoreDefsProcessed");

            string  sourceCodePath = @"C:\git\rw\RimWorld-Decompile\Assembly-CSharp";
            Capture templates      = Capture.Parse(coreDefinitionData, sourceCodePath, true);

            templates.Save(@"C:\git\rw\RimWorld-Defs-Templates\Templates");
        }