コード例 #1
0
        private void LaunchShogun(object sender, EventArgs e)
        {
            List <string> notYetInstalled = new List <string>();

            if (SelectedMod != null && SelectedMod.EditedAfterPackCreation.Count > 1)
            {
                if (MessageBox.Show(
                        string.Format("The current mod ({0}) contains data that was not yet added to its pack.\nStart anyway?", SelectedMod.Name),
                        "Non-current mods detected", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
            }
            foreach (Mod mod in MultiMods.Instance.Mods)
            {
                if (File.GetLastWriteTime(mod.InstalledPackPath) < File.GetLastWriteTime(mod.PackFilePath))
                {
                    notYetInstalled.Add(string.Format("- {0}", mod.Name));
                }
            }
            if (notYetInstalled.Count > 0 && MessageBox.Show(
                    string.Format("The packs for the following mods are more recent than the one installed:\n{0}\nStart anyway?",
                                  string.Join("\n", notYetInstalled)),
                    "Non-current mods detected", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }
            ProcessStartInfo info = new ProcessStartInfo {
                Arguments = "-applaunch 34330"
            };

            ExternalProcesses.Launch("Steam", info);
        }
コード例 #2
0
 private void LaunchWithMod(string executable, string[] args = null)
 {
     if (SelectedMod != null)
     {
         SetMod();
         ProcessStartInfo info = new ProcessStartInfo(executable)
         {
             WorkingDirectory = ModTools.Instance.BinariesPath
         };
         Process process = ExternalProcesses.Launch(executable, info);
         if (process != null)
         {
             process.EnableRaisingEvents = true;
             process.Exited += ProcessExited;
             startedProcesses.Add(process);
         }
     }
     else
     {
         MessageBox.Show("Select or set a mod to work with.", "No active mod", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }