Make launch confirmation optional

This commit is contained in:
pizzaboxer 2024-06-17 12:48:01 +01:00
parent cd34f2a108
commit 66b0b58fec
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
6 changed files with 55 additions and 6 deletions

View File

@ -204,13 +204,13 @@ namespace Bloxstrap
if (!IsFirstRun) if (!IsFirstRun)
ShouldSaveConfigs = true; ShouldSaveConfigs = true;
if (Mutex.TryOpenExisting("ROBLOX_singletonMutex", out var _)) if (Settings.Prop.ConfirmLaunches && Mutex.TryOpenExisting("ROBLOX_singletonMutex", out var _))
{ {
var result = Frontend.ShowMessageBox( // this currently doesn't work very well since it relies on checking the existence of the singleton mutex
"Roblox is currently running, and launching another instance will close it. Are you sure you want to continue launching?", // which often hangs around for a few seconds after the window closes
MessageBoxImage.Warning, // it would be better to have this rely on the activity tracker when we implement IPC in the planned refactoring
MessageBoxButton.YesNo
); var result = Frontend.ShowMessageBox(Bloxstrap.Resources.Strings.Bootstrapper_ConfirmLaunch, MessageBoxImage.Warning, MessageBoxButton.YesNo);
if (result != MessageBoxResult.Yes) if (result != MessageBoxResult.Yes)
{ {

View File

@ -12,6 +12,7 @@ namespace Bloxstrap.Models
public Theme Theme { get; set; } = Theme.Default; public Theme Theme { get; set; } = Theme.Default;
public bool CheckForUpdates { get; set; } = true; public bool CheckForUpdates { get; set; } = true;
public bool CreateDesktopIcon { get; set; } = true; public bool CreateDesktopIcon { get; set; } = true;
public bool ConfirmLaunches { get; set; } = false;
// channel configuration // channel configuration
public string Channel { get; set; } = RobloxDeployment.DefaultChannel; public string Channel { get; set; } = RobloxDeployment.DefaultChannel;

View File

@ -87,6 +87,15 @@ namespace Bloxstrap.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Roblox is currently running, and launching another instance will close it. Are you sure you want to continue launching?.
/// </summary>
public static string Bootstrapper_ConfirmLaunch {
get {
return ResourceManager.GetString("Bootstrapper.ConfirmLaunch", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to It&apos;s possible that something is preventing Bloxstrap from connecting to the internet. Please check and try again.. /// Looks up a localized string similar to It&apos;s possible that something is preventing Bloxstrap from connecting to the internet. Please check and try again..
/// </summary> /// </summary>
@ -1634,6 +1643,24 @@ namespace Bloxstrap.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Prevent against closures of your existing game from accidentally launching another one..
/// </summary>
public static string Menu_Behaviour_ConfirmLaunches_Description {
get {
return ResourceManager.GetString("Menu.Behaviour.ConfirmLaunches.Description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Prompt to confirm when launching another Roblox instance.
/// </summary>
public static string Menu_Behaviour_ConfirmLaunches_Title {
get {
return ResourceManager.GetString("Menu.Behaviour.ConfirmLaunches.Title", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Bloxstrap will place an icon on the desktop that launches Roblox the next time it launches.. /// Looks up a localized string similar to Bloxstrap will place an icon on the desktop that launches Roblox the next time it launches..
/// </summary> /// </summary>

View File

@ -126,6 +126,9 @@
<data name="Bootstrapper.AutoUpdateFailed" xml:space="preserve"> <data name="Bootstrapper.AutoUpdateFailed" xml:space="preserve">
<value>Bloxstrap was unable to auto-update to {0}. Please update it manually by downloading and running the latest release from the GitHub page.</value> <value>Bloxstrap was unable to auto-update to {0}. Please update it manually by downloading and running the latest release from the GitHub page.</value>
</data> </data>
<data name="Bootstrapper.ConfirmLaunch" xml:space="preserve">
<value>Roblox is currently running, and launching another instance will close it. Are you sure you want to continue launching?</value>
</data>
<data name="Bootstrapper.Connectivity.Preventing" xml:space="preserve"> <data name="Bootstrapper.Connectivity.Preventing" xml:space="preserve">
<value>It's possible that something is preventing Bloxstrap from connecting to the internet. Please check and try again.</value> <value>It's possible that something is preventing Bloxstrap from connecting to the internet. Please check and try again.</value>
</data> </data>
@ -650,6 +653,12 @@ Would you like to upgrade your currently installed version?</value>
<data name="Menu.Behaviour.AutoUpdate.Title" xml:space="preserve"> <data name="Menu.Behaviour.AutoUpdate.Title" xml:space="preserve">
<value>Automatically update Bloxstrap</value> <value>Automatically update Bloxstrap</value>
</data> </data>
<data name="Menu.Behaviour.ConfirmLaunches.Description" xml:space="preserve">
<value>Prevent against closures of your existing game from accidentally launching another one.</value>
</data>
<data name="Menu.Behaviour.ConfirmLaunches.Title" xml:space="preserve">
<value>Prompt to confirm when launching another Roblox instance</value>
</data>
<data name="Menu.Behaviour.CreateDesktopIcon.Description" xml:space="preserve"> <data name="Menu.Behaviour.CreateDesktopIcon.Description" xml:space="preserve">
<value>Bloxstrap will place an icon on the desktop that launches Roblox the next time it launches.</value> <value>Bloxstrap will place an icon on the desktop that launches Roblox the next time it launches.</value>
</data> </data>

View File

@ -43,5 +43,11 @@
</controls:OptionControl.Style> </controls:OptionControl.Style>
<ui:ToggleSwitch IsChecked="{Binding ForceRobloxReinstallation, Mode=TwoWay}" /> <ui:ToggleSwitch IsChecked="{Binding ForceRobloxReinstallation, Mode=TwoWay}" />
</controls:OptionControl> </controls:OptionControl>
<controls:OptionControl
Header="{x:Static resources:Strings.Menu_Behaviour_ConfirmLaunches_Title}"
Description="{x:Static resources:Strings.Menu_Behaviour_ConfirmLaunches_Description}">
<ui:ToggleSwitch IsChecked="{Binding ConfirmLaunches, Mode=TwoWay}" />
</controls:OptionControl>
</StackPanel> </StackPanel>
</ui:UiPage> </ui:UiPage>

View File

@ -17,6 +17,12 @@
set => App.Settings.Prop.CheckForUpdates = value; set => App.Settings.Prop.CheckForUpdates = value;
} }
public bool ConfirmLaunches
{
get => App.Settings.Prop.ConfirmLaunches;
set => App.Settings.Prop.ConfirmLaunches = value;
}
public bool ForceRobloxReinstallation public bool ForceRobloxReinstallation
{ {
// wouldnt it be better to check old version guids? // wouldnt it be better to check old version guids?