public static void Main(string[] args) { var rebirthProc = Process.GetProcessesByName("XRebirth"); if (rebirthProc.Any()) { rebirthProc[0].CloseMainWindow(); Thread.Sleep(1000); } var basePath = args[0]; var modNames = args[1]; if (args.Length > 2) { ModPackager.LuaCompilerPath = args[2]; } var baseDir = new DirectoryInfo(basePath); foreach (var mod in modNames.Split(',')) { var modDir = new DirectoryInfo(string.Format(@"{0}\{1}", baseDir.FullName, mod)); modDir = modDir = modDir.GetDirectories().SingleOrDefault(di => string.Compare(di.Name, "Extension", true) == 0) ?? modDir; ModPackager.PackageMod(mod, modDir); } var rebirthExe = Steam.Steam.GetXRebirthDirectory().GetFiles().Single(fi => fi.Name == "XRebirth.exe"); ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = rebirthExe.FullName; Process.Start(startInfo); }
/// <summary> /// A simple constructor that initializes the object with the given values. /// </summary> /// <param name="p_vmlScriptEditorVM">The <see cref="InstallScriptEditorVM"/> that encapsulates the data /// and operations for diaplying the <see cref="IScript"/> editor.</param> /// <param name="p_vmlInfoEditorVM">The <see cref="ModInfoEditorVM"/> that encapsulates the data /// and operations for diaplying the <see cref="IModInfo"/> editor.</param> /// <param name="p_prjModProject">The <see cref="Project"/> to edit.</param> /// <param name="p_srgScriptTypeRegistry">The <see cref="IScriptTypeRegistry"/> of available <see cref="IScriptType"/>s.</param> /// <param name="p_mpkModBuilder">he <see cref="ModPackager"/> to use to build mod files /// from <see cref="Project"/>s.</param> public ModPackagingFormVM(InstallScriptEditorVM p_vmlScriptEditorVM, ModInfoEditorVM p_vmlInfoEditorVM, Project p_prjModProject, IScriptTypeRegistry p_srgScriptTypeRegistry, ModPackager p_mpkModBuilder) { Errors = new ErrorContainer(); Warnings = new ErrorContainer(); ScriptEditorVM = p_vmlScriptEditorVM; InfoEditorVM = p_vmlInfoEditorVM; IScriptTypeRegistry = p_srgScriptTypeRegistry; ModBuilder = p_mpkModBuilder; ModProject = p_prjModProject ?? new Project(p_srgScriptTypeRegistry); SaveCommand = new Command <string>("Save Project", "Save the project.", SaveProject, ModProject.IsDirty); OpenCommand = new Command("Open Project", "Open a project.", OpenProject); NewCommand = new Command("New Project", "Create a new project.", NewProject); BuildCommand = new Command <string>("Build Mod", "Builds the mod file.", BuildMod); }
/// <summary> /// A simple constructor that initializes the object with the given values. /// </summary> /// <param name="p_vmlScriptEditorVM">The <see cref="InstallScriptEditorVM"/> that encapsulates the data /// and operations for diaplying the <see cref="IScript"/> editor.</param> /// <param name="p_vmlInfoEditorVM">The <see cref="ModInfoEditorVM"/> that encapsulates the data /// and operations for diaplying the <see cref="IModInfo"/> editor.</param> /// <param name="p_prjModProject">The <see cref="Project"/> to edit.</param> /// <param name="p_srgScriptTypeRegistry">The <see cref="IScriptTypeRegistry"/> of available <see cref="IScriptType"/>s.</param> /// <param name="p_mpkModBuilder">he <see cref="ModPackager"/> to use to build mod files /// from <see cref="Project"/>s.</param> public ModPackagingFormVM(InstallScriptEditorVM p_vmlScriptEditorVM, ModInfoEditorVM p_vmlInfoEditorVM, Project p_prjModProject, IScriptTypeRegistry p_srgScriptTypeRegistry, ModPackager p_mpkModBuilder) { Errors = new ErrorContainer(); Warnings = new ErrorContainer(); ScriptEditorVM = p_vmlScriptEditorVM; InfoEditorVM = p_vmlInfoEditorVM; IScriptTypeRegistry = p_srgScriptTypeRegistry; ModBuilder = p_mpkModBuilder; ModProject = p_prjModProject ?? new Project(p_srgScriptTypeRegistry); SaveCommand = new Command<string>("Save Project", "Save the project.", SaveProject, ModProject.IsDirty); OpenCommand = new Command("Open Project", "Open a project.", OpenProject); NewCommand = new Command("New Project", "Create a new project.", NewProject); BuildCommand = new Command<string>("Build Mod", "Builds the mod file.", BuildMod); }