Merge pull request #772 from bluepilledgreat/bugfix/fix-studio-shortcut

Fix studio shortcut not working
This commit is contained in:
pizzaboxer 2023-10-16 08:09:45 +01:00 committed by GitHub
commit 7513b7e6eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -197,7 +197,7 @@ namespace Bloxstrap
#endif #endif
string commandLine = ""; string commandLine = "";
LaunchMode launchMode = LaunchMode.Player; LaunchMode? launchMode = null;
if (IsMenuLaunch) if (IsMenuLaunch)
{ {
@ -225,6 +225,8 @@ namespace Bloxstrap
if (LaunchArgs[0].StartsWith("roblox-player:")) if (LaunchArgs[0].StartsWith("roblox-player:"))
{ {
commandLine = ProtocolHandler.ParseUri(LaunchArgs[0]); commandLine = ProtocolHandler.ParseUri(LaunchArgs[0]);
launchMode = LaunchMode.Player;
} }
else if (LaunchArgs[0].StartsWith("roblox:")) else if (LaunchArgs[0].StartsWith("roblox:"))
{ {
@ -235,6 +237,8 @@ namespace Bloxstrap
); );
commandLine = $"--app --deeplink {LaunchArgs[0]}"; commandLine = $"--app --deeplink {LaunchArgs[0]}";
launchMode = LaunchMode.Player;
} }
else if (LaunchArgs[0].StartsWith("roblox-studio:")) else if (LaunchArgs[0].StartsWith("roblox-studio:"))
{ {
@ -248,6 +252,7 @@ namespace Bloxstrap
else if (LaunchArgs[0].StartsWith("roblox-studio-auth:")) else if (LaunchArgs[0].StartsWith("roblox-studio-auth:"))
{ {
commandLine = HttpUtility.UrlDecode(LaunchArgs[0]); commandLine = HttpUtility.UrlDecode(LaunchArgs[0]);
launchMode = LaunchMode.StudioAuth; launchMode = LaunchMode.StudioAuth;
} }
else if (LaunchArgs[0] == "-ide") else if (LaunchArgs[0] == "-ide")
@ -260,21 +265,25 @@ namespace Bloxstrap
else else
{ {
commandLine = "--app"; commandLine = "--app";
launchMode = LaunchMode.Player;
} }
} }
else else
{ {
commandLine = "--app"; commandLine = "--app";
launchMode = LaunchMode.Player;
} }
if (!String.IsNullOrEmpty(commandLine)) if (launchMode != null)
{ {
if (!IsFirstRun) if (!IsFirstRun)
ShouldSaveConfigs = true; ShouldSaveConfigs = true;
// start bootstrapper and show the bootstrapper modal if we're not running silently // start bootstrapper and show the bootstrapper modal if we're not running silently
Logger.WriteLine(LOG_IDENT, "Initializing bootstrapper"); Logger.WriteLine(LOG_IDENT, "Initializing bootstrapper");
Bootstrapper bootstrapper = new(commandLine, launchMode); Bootstrapper bootstrapper = new(commandLine, (LaunchMode)launchMode);
IBootstrapperDialog? dialog = null; IBootstrapperDialog? dialog = null;
if (!IsQuiet) if (!IsQuiet)