diff --git a/Falcon BMS Alternative Launcher/App.config b/Falcon BMS Alternative Launcher/App.config index 16b16d5..71b0a83 100644 --- a/Falcon BMS Alternative Launcher/App.config +++ b/Falcon BMS Alternative Launcher/App.config @@ -89,6 +89,9 @@ False + + False + diff --git a/Falcon BMS Alternative Launcher/AppProperties.cs b/Falcon BMS Alternative Launcher/AppProperties.cs index a925dc7..1f130e9 100644 --- a/Falcon BMS Alternative Launcher/AppProperties.cs +++ b/Falcon BMS Alternative Launcher/AppProperties.cs @@ -21,6 +21,7 @@ public AppProperties(MainWindow mainWindow) mainWindow.CMD_EF.IsOn = Properties.Settings.Default.CMD_EF; mainWindow.CMD_MONO.IsOn = Properties.Settings.Default.CMD_MONO; + mainWindow.KeepLauncherOpen.IsChecked = Properties.Settings.Default.KeepLauncherOpen; mainWindow.ApplicationOverride.IsChecked = Properties.Settings.Default.NoOverride; mainWindow.Misc_RollLinkedNWS.IsChecked = Properties.Settings.Default.Misc_RLNWS; @@ -86,6 +87,7 @@ public void SaveUISetup() Properties.Settings.Default.CMD_EF = (bool)mainWindow.CMD_EF.IsOn; Properties.Settings.Default.CMD_MONO = (bool)mainWindow.CMD_MONO.IsOn; + Properties.Settings.Default.KeepLauncherOpen = (bool)mainWindow.KeepLauncherOpen.IsChecked; Properties.Settings.Default.NoOverride = (bool)mainWindow.ApplicationOverride.IsChecked; Properties.Settings.Default.Misc_RLNWS = (bool)mainWindow.Misc_RollLinkedNWS.IsChecked; diff --git a/Falcon BMS Alternative Launcher/Properties/Settings.Designer.cs b/Falcon BMS Alternative Launcher/Properties/Settings.Designer.cs index 9f8d0ba..af32122 100644 --- a/Falcon BMS Alternative Launcher/Properties/Settings.Designer.cs +++ b/Falcon BMS Alternative Launcher/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace FalconBMS.Launcher.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.10.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -334,5 +334,17 @@ public bool Misc_bExportRTTTextures { this["Misc_bExportRTTTextures"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool KeepLauncherOpen { + get { + return ((bool)(this["KeepLauncherOpen"])); + } + set { + this["KeepLauncherOpen"] = value; + } + } } } diff --git a/Falcon BMS Alternative Launcher/Properties/Settings.settings b/Falcon BMS Alternative Launcher/Properties/Settings.settings index e96d638..3aa9a42 100644 --- a/Falcon BMS Alternative Launcher/Properties/Settings.settings +++ b/Falcon BMS Alternative Launcher/Properties/Settings.settings @@ -80,5 +80,8 @@ False + + False + \ No newline at end of file diff --git a/Falcon BMS Alternative Launcher/Starter/Starter432.cs b/Falcon BMS Alternative Launcher/Starter/Starter432.cs index ea104f8..285ebd5 100644 --- a/Falcon BMS Alternative Launcher/Starter/Starter432.cs +++ b/Falcon BMS Alternative Launcher/Starter/Starter432.cs @@ -26,6 +26,7 @@ public override void execute(object sender) process = Utils.LaunchProcess(appReg.GetInstallDir() + "/Updater.exe"); mainWindow.Close(); break; + case "Launch_BMS_Large": string strCmdText = getCommandLine(); @@ -35,8 +36,19 @@ public override void execute(object sender) string bmsExe = appReg.GetInstallDir() + "/Bin/x86/Falcon BMS.exe"; process = Utils.LaunchProcess(bmsExe, strCmdText); MainWindow.bmsHasBeenLaunched = true; - mainWindow.Close(); + + if (Properties.Settings.Default.KeepLauncherOpen) + { + // Stay open: minimize while BMS runs, then restore on exit + mainWindow.minimizeWindowUntilProcessEnds(process); + } + else + { + // Default behavior: close after launching BMS + mainWindow.Close(); + } break; + case "Launch_CFG": process = Utils.LaunchProcess(appReg.GetInstallDir() + "/Config.exe"); mainWindow.minimizeWindowUntilProcessEnds(process); diff --git a/Falcon BMS Alternative Launcher/Starter/Starter433.cs b/Falcon BMS Alternative Launcher/Starter/Starter433.cs index 38586a8..16e75a8 100644 --- a/Falcon BMS Alternative Launcher/Starter/Starter433.cs +++ b/Falcon BMS Alternative Launcher/Starter/Starter433.cs @@ -29,6 +29,7 @@ public override void execute(object sender) process = Utils.LaunchProcess(appReg.GetInstallDir() + "/Updater.exe"); mainWindow.Close(); break; + case "Launch_BMS_Large": string strCmdText = getCommandLine(); @@ -41,8 +42,19 @@ public override void execute(object sender) process = Utils.LaunchProcess(bmsExe, strCmdText); MainWindow.bmsHasBeenLaunched = true; - mainWindow.Close(); + + if (Properties.Settings.Default.KeepLauncherOpen) + { + // Stay open: minimize while BMS runs, then restore on exit + mainWindow.minimizeWindowUntilProcessEnds(process); + } + else + { + // Default behavior: close after launching BMS + mainWindow.Close(); + } break; + case "Launch_CFG": process = Utils.LaunchProcess(appReg.GetInstallDir() + "/Config.exe"); mainWindow.minimizeWindowUntilProcessEnds(process); diff --git a/Falcon BMS Alternative Launcher/Starter/Starter434.cs b/Falcon BMS Alternative Launcher/Starter/Starter434.cs index 2612f64..d6a34fb 100644 --- a/Falcon BMS Alternative Launcher/Starter/Starter434.cs +++ b/Falcon BMS Alternative Launcher/Starter/Starter434.cs @@ -29,6 +29,7 @@ public override void execute(object sender) process = Utils.LaunchProcess(appReg.GetInstallDir() + "/Updater.exe"); mainWindow.Close(); break; + case "Launch_BMS_Large": string strCmdText = getCommandLine(); @@ -38,8 +39,19 @@ public override void execute(object sender) string bmsExe = appReg.GetInstallDir() + "/Bin/x64/Falcon BMS.exe"; process = Utils.LaunchProcess(bmsExe, strCmdText); MainWindow.bmsHasBeenLaunched = true; - mainWindow.Close(); + + if (Properties.Settings.Default.KeepLauncherOpen) + { + // Stay open: minimize while BMS runs, then restore on exit + mainWindow.minimizeWindowUntilProcessEnds(process); + } + else + { + // Default behavior: close after launching BMS + mainWindow.Close(); + } break; + case "Launch_CFG": process = Utils.LaunchProcess(appReg.GetInstallDir() + "/Config.exe"); mainWindow.minimizeWindowUntilProcessEnds(process); diff --git a/Falcon BMS Alternative Launcher/Starter/Starter435.cs b/Falcon BMS Alternative Launcher/Starter/Starter435.cs index 1dc1e92..32aaf79 100644 --- a/Falcon BMS Alternative Launcher/Starter/Starter435.cs +++ b/Falcon BMS Alternative Launcher/Starter/Starter435.cs @@ -29,6 +29,7 @@ public override void execute(object sender) process = Utils.LaunchProcess(appReg.GetInstallDir() + "/Updater.exe"); mainWindow.Close(); break; + case "Launch_BMS_Large": string strCmdText = getCommandLine(); @@ -36,7 +37,8 @@ public override void execute(object sender) mainWindow.executeOverride(); string testPlatform = appReg.GetInstallDir() + "/Bin/x64/Falcon BMS Test.exe"; - if (File.Exists(testPlatform) && MessageBox.Show(Program.mainWin, "Start Test Exe?", "Launcher", MessageBoxButton.YesNo) == MessageBoxResult.Yes) + if (File.Exists(testPlatform) && + MessageBox.Show(Program.mainWin, "Start Test Exe?", "Launcher", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { process = Utils.LaunchProcess(testPlatform, strCmdText); MainWindow.bmsHasBeenLaunched = true; @@ -47,8 +49,19 @@ public override void execute(object sender) process = Utils.LaunchProcess(bmsExe, strCmdText); MainWindow.bmsHasBeenLaunched = true; } - mainWindow.Close(); + + if (Properties.Settings.Default.KeepLauncherOpen) + { + // Stay open: minimize while BMS runs, then restore on exit + mainWindow.minimizeWindowUntilProcessEnds(process); + } + else + { + // Default behavior: close after launching BMS + mainWindow.Close(); + } break; + case "Launch_CFG": process = Utils.LaunchProcess(appReg.GetInstallDir() + "/Config.exe"); mainWindow.minimizeWindowUntilProcessEnds(process); diff --git a/Falcon BMS Alternative Launcher/Starter/Starter436I.cs b/Falcon BMS Alternative Launcher/Starter/Starter436I.cs index 48aa6d5..ce61e4c 100644 --- a/Falcon BMS Alternative Launcher/Starter/Starter436I.cs +++ b/Falcon BMS Alternative Launcher/Starter/Starter436I.cs @@ -29,6 +29,7 @@ public override void execute(object sender) process = Utils.LaunchProcess(appReg.GetInstallDir() + "/Updater.exe"); mainWindow.Close(); break; + case "Launch_BMS_Large": string strCmdText = getCommandLine(); @@ -38,8 +39,19 @@ public override void execute(object sender) string bmsExe = appReg.GetInstallDir() + "/Bin/x64/Falcon BMS.exe"; process = Utils.LaunchProcess(bmsExe, strCmdText); MainWindow.bmsHasBeenLaunched = true; - mainWindow.Close(); + + if (Properties.Settings.Default.KeepLauncherOpen) + { + // Stay open: minimize while BMS runs, then restore on exit + mainWindow.minimizeWindowUntilProcessEnds(process); + } + else + { + // Default behavior: close after launching BMS + mainWindow.Close(); + } break; + case "Launch_CFG": process = Utils.LaunchProcess(appReg.GetInstallDir() + "/Config.exe"); mainWindow.minimizeWindowUntilProcessEnds(process); diff --git a/Falcon BMS Alternative Launcher/Windows/MainWindow.xaml b/Falcon BMS Alternative Launcher/Windows/MainWindow.xaml index 28a01c7..186867b 100644 --- a/Falcon BMS Alternative Launcher/Windows/MainWindow.xaml +++ b/Falcon BMS Alternative Launcher/Windows/MainWindow.xaml @@ -149,7 +149,11 @@