public static void ExportAll(string GameDir, string exportPath)
        {
            Util.PrepareExportDirectory(exportPath);
            var scriptExporter = new ScriptExporter(GameDir, exportPath);

            scriptExporter.DoExportAll();
        }
        public static void ExportDLL(string GameDir, string dllPath, string exportPath, bool scriptByName)
        {
            Util.PrepareExportDirectory(exportPath);
            var scriptExporter = new ScriptExporter(GameDir, exportPath, scriptByName);

            scriptExporter.DoExportDLL(dllPath);
        }
        public static void Export(string GameDir, string exportPath, Func <MonoScript, bool> filter = null)
        {
            if (filter == null)
            {
                filter = ScriptSelector;
            }
            Util.PrepareExportDirectory(exportPath);
            var scriptExporter = new ScriptExporter(GameDir, exportPath);

            scriptExporter.DoExport(filter);
        }
示例#4
0
        static void Main(string[] args)
        {
            Logger.Instance      = new ConsoleLogger("log.txt");
            Config.IsAdvancedLog = true;
            Stopwatch sw = new Stopwatch();

            sw.Start();
            Parser.Default.ParseArguments <Options>(args)
            .WithParsed <Options>(o =>
            {
                Config.IsGenerateGUIDByContent = o.GUIDByContent;
                Config.IsExportDependencies    = o.ExportDependencies;
                if (o.ExportScripts)
                {
                    ScriptExporter.ExportAll(o.GameDir, o.ExportDir);
                }
                else if (o.DumpInfo)
                {
                    DumpInfo.DumpAllFileInfo(o.GameDir, $"{o.ExportDir}");
                }
                else if (o.File == null)
                {
                    GameStructureExporter.ExportGameStructure(o.GameDir, o.ExportDir);
                }
                else if (o.File.EndsWith(".dll"))
                {
                    ScriptExporter.ExportDLL(o.GameDir, o.File, o.ExportDir);
                }
                else
                {
                    GameStructureExporter.ExportBundles(o.GameDir, new string[] { o.File }, o.ExportDir, true);
                }
                if (o.FixScripts)
                {
                    var dirName = Path.GetFileName(o.GameDir);
                    if (dirName == "Kingmaker_Data")
                    {
                        ScriptFixer.FixKingmakerScripts(o.ExportDir);
                    }
                    if (dirName == "PillarsOfEternityII_Data")
                    {
                        ScriptFixer.FixPoE2Scripts(o.ExportDir);
                    }
                }
            });
            sw.Stop();
            Logger.Instance.Log(LogType.Debug, LogCategory.Debug, $"Elapsed={Util.FormatTime(sw.Elapsed)}");
        }
示例#5
0
        static void Main(string[] args)
        {
            Logger.Instance = new ConsoleLogger("log.txt");
            Stopwatch sw = new Stopwatch();

            sw.Start();
            Parser.Default.ParseArguments <ExportSettings>(args)
            .WithParsed <ExportSettings>(o =>
            {
                if (o.ExportScripts)
                {
                    ScriptExporter.ExportAll(o.GameDir, o.ExportDir, o.ScriptByName);
                }
                else if (o.DumpInfo)
                {
                    DumpInfo.DumpAllFileInfo(o.GameDir, o.ExportDir);
                }
                else if (o.File == null)
                {
                    GameStructureExporter.ExportGameStructure(o);
                }
                else if (o.File.EndsWith(".dll"))
                {
                    ScriptExporter.ExportDLL(o.GameDir, o.File, o.ExportDir, o.ScriptByName);
                }
                else
                {
                    GameStructureExporter.ExportBundles(o, new string[] { o.File }, true);
                }
                if (o.FixScripts)
                {
                    var dirName = Path.GetFileName(o.GameDir);
                    if (dirName == "Kingmaker_Data")
                    {
                        ScriptFixer.FixKingmakerScripts(o.ExportDir);
                    }
                }
            });
            sw.Stop();
            Logger.Instance.Log(LogType.Debug, LogCategory.Debug, $"Elapsed={Util.FormatTime(sw.Elapsed)}");
        }