private void allPathsAtOnceToolStripMenuItem_Click(object sender, EventArgs e) { string[] biogames = new string[3]; biogames[0] = ME1Directory.GamePath(); biogames[1] = ME2Directory.GamePath(); biogames[2] = ME3Directory.GamePath(); // KFreon: Display PathChanger using (KFreonLib.Helpers.PathChanger changer = new KFreonLib.Helpers.PathChanger(biogames[0], biogames[1], biogames[2])) { if (changer.ShowDialog() == System.Windows.Forms.DialogResult.OK) { // KFreon: Change paths Properties.Settings.Default.ME1InstallDir = changer.PathME1; Properties.Settings.Default.ME2InstallDir = changer.PathME2; Properties.Settings.Default.ME3InstallDir = changer.PathME3; KFreonLib.MEDirectories.MEDirectories.SaveSettings(new List <string>() { changer.PathME1, changer.PathME2, changer.PathME2 }); ME1Directory.GamePath(changer.PathME1); ME2Directory.GamePath(changer.PathME2); ME3Directory.GamePath(changer.PathME3); } } }
public void ChangePaths() { string[] biogames = new string[3]; biogames[0] = ME1Directory.GamePath(); biogames[1] = ME2Directory.GamePath(); biogames[2] = ME3Directory.GamePath(); // KFreon: Display PathChanger using (KFreonLib.Helpers.PathChanger changer = new KFreonLib.Helpers.PathChanger(biogames[0], biogames[1], biogames[2])) { if (changer.ShowDialog() == System.Windows.Forms.DialogResult.OK) { // KFreon: Change paths Properties.Settings.Default.ME1InstallDir = changer.PathME1; Properties.Settings.Default.ME2InstallDir = changer.PathME2; Properties.Settings.Default.ME3InstallDir = changer.PathME3; KFreonLib.MEDirectories.MEDirectories.SaveSettings(new List <string>() { changer.PathME1, changer.PathME2, changer.PathME2 }); ME1Directory.GamePath(changer.PathME1); ME2Directory.GamePath(changer.PathME2); ME3Directory.GamePath(changer.PathME3); OnPropertyChanged(nameof(ME1Path)); OnPropertyChanged(nameof(ME2Path)); OnPropertyChanged(nameof(ME3Path)); } } }
private void massEffect2ToolStripMenuItem_Click(object sender, EventArgs e) { String installPath = KFreonLib.Misc.Methods.SelectGameLoc(2); if (String.IsNullOrEmpty(installPath)) { return; } ME2Directory.GamePath(installPath); Properties.Settings.Default.ME2InstallDir = installPath; Properties.Settings.Default.Save(); MessageBox.Show("New path setting saved", "Success", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); }
private void Form1_Load(object sender, EventArgs e) { taskbar.strip = toolStrip1; //this be a toolstrip reference to class taskbar string loc = Path.GetDirectoryName(Application.ExecutablePath); lang = new Languages(loc + "\\exec\\languages.xml", 0); lang.SetLang(this); string[] args = Environment.GetCommandLineArgs(); if (args.Length > 1) { AttachConsole(ATTACH_PARENT_PROCESS); if (args[1].Equals("-version-switch-from") && args.Length == 3) { string version = Assembly.GetExecutingAssembly().GetName().Version.Build.ToString(); if (version.Equals(args[2])) { MessageBox.Show("Version switched to is the same as the one you had before the switch."); } else { MessageBox.Show("Version switched: " + args[2] + " => " + version); } } else //automation if (args[1].Equals("-dlcinject") || args[1].Equals("-dlcextract") || args[1].Equals("-dlcaddfiles") || args[1].Equals("-dlcremovefiles") || args[1].Equals("-dlcunpack") || args[1].Equals("-dlcunpack-nodebug")) { //autostart DLC editor 2 (used by FemShep's Mod Manager 3/3.1+) //saves a little duplicate code dLCEditor2ToolStripMenuItem.PerformClick(); return; } else if (args[1].Equals("-toceditorupdate")) { //autostart the TOCEditor (used by FemShep's Mod Manager 3) //saves a little duplicate code tOCbinEditorToolStripMenuItem.PerformClick(); return; } if (args[1].Equals("-autotoc")) { //autostart the AutoTOC Tool (uses a path) (used by FemShep's Mod Manager 3) //saves a little duplicate code autoTOCToolStripMenuItem.PerformClick(); return; } else if (args[1].Equals("-decompresspcc")) { //autostart the TOCEditor (used by FemShep's Mod Manager 3.2) //saves a little duplicate code pCCRepackerToolStripMenuItem.PerformClick(); return; } else if (args[1].Equals("--help") || args[1].Equals("-h") || args[1].Equals("/?")) { String[] version = Assembly.GetExecutingAssembly().GetName().Version.ToString().Split('.'); String commandLineHelp = "\nME3Explorer r" + version[2] + " Command Line Options\n"; commandLineHelp += " -decompresspcc pccPath.pcc decompressedPath.pcc\n"; commandLineHelp += " Automates PCCRepacker to decompress a pcc to the new location.\n\n"; commandLineHelp += " -dlcinject DLC.sfar SearchTerm PathToNewFile [SearchTerm2 PathToNewFile2]...\n"; commandLineHelp += " Automates injecting pairs of files into a .sfar file using DLCEditor2. SearchTerm is a value you would type into the searchbox with the first result being the file that will be replaced.\n\n"; commandLineHelp += " -dlcextract DLC.sfar SearchTerm ExtractionPath\n"; commandLineHelp += " Automates DLCEditor2 to extract the specified SearchTerm. SearchTerm is a value you would type into the searchbox with the first result being the file that will be extracted. The file is extracted to the specied ExtractionPath.\n\n"; commandLineHelp += " -dlcaddfiles DLC.sfar InternalPath NewFile [InternalPath2 NewFile2]...\n"; commandLineHelp += " Automates DLCEditor2 to add the specified new files. InternalPath is the internal path in the SFAR the file NewFile will be placed at.\n\n"; commandLineHelp += " -dlcremovefiles DLC.sfar SearchTerm [SearchTerm2]...\n"; commandLineHelp += " Automates removing a file or list of files from a DLC. SearchTerm is a value you would type into the Searchbox with the first result being the file that will be removed.\n\n"; commandLineHelp += " -dlcunpack DLC.sfar Unpackpath\n"; commandLineHelp += " Automates unpacking an SFAR file to the specified directory. Shows the debug interface to show progress. To unpack a game DLC for use by the game, unpack to the Mass Effect 3 directory. Unpacking Patch_001.sfar will cause the game to crash at startup.\n\n"; commandLineHelp += " -dlcunpack-nodebug DLC.sfar Unpackpath\n"; commandLineHelp += " Same as -dlcunpack but does not show the debugging interface.\n\n"; commandLineHelp += " -toceditorupdate PCConsoleTOCFile.bin SearchTerm size\n"; commandLineHelp += " Automates DLCEditor2 to extract the specified SearchTerm. SearchTerm is a value you would type into the searchbox with the first result being the file that will be extracted. The file is extracted to the specied ExtractionPath.\n\n"; System.Console.WriteLine(commandLineHelp); Environment.Exit(0); Application.Exit(); return; } string ending = Path.GetExtension(args[1]).ToLower(); switch (ending) { case ".pcc": PCCEditor2 editor = new PCCEditor2(); editor.MdiParent = this; editor.Show(); editor.WindowState = FormWindowState.Maximized; editor.LoadFile(args[1]); break; case ".txt": ScriptCompiler sc = new ScriptCompiler(); sc.MdiParent = this; sc.rtb1.LoadFile(args[1]); sc.Compile(); sc.Show(); sc.WindowState = FormWindowState.Maximized; break; case ".mod": ModMaker m = new ModMaker(); m.Show(); string[] s = new string[1]; s[0] = args[1]; //m.LoadMods(s); m.WindowState = FormWindowState.Maximized; break; } } if (!String.IsNullOrEmpty(Properties.Settings.Default.ME3InstallDir)) { ME3Directory.GamePath(Properties.Settings.Default.ME3InstallDir); } if (!String.IsNullOrEmpty(Properties.Settings.Default.ME2InstallDir)) { ME2Directory.GamePath(Properties.Settings.Default.ME2InstallDir); } if (!String.IsNullOrEmpty(Properties.Settings.Default.ME1InstallDir)) { ME1Directory.GamePath(Properties.Settings.Default.ME1InstallDir); } var vers = Assembly.GetExecutingAssembly().GetName().Version.ToString().Split('.'); versionToolStripMenuItem.Text += "0110 (r" + vers[2] + ")"; versionToolStripMenuItem.Tag = "versionItem"; menuStrip1.Renderer = new NoHighlightRenderer(); }