Fix program flow bug w/ launch settings

this is a nasty bandaid fix that ideally will be removed when we actually work on it
This commit is contained in:
pizzaboxer 2024-06-14 22:37:23 +01:00
parent 5cf49b444c
commit 989ba00995
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
2 changed files with 13 additions and 2 deletions

View File

@ -144,6 +144,8 @@ namespace Bloxstrap
FastFlags.Load(); FastFlags.Load();
} }
LaunchSettings.ParseRoblox();
HttpClient.Timeout = TimeSpan.FromSeconds(30); HttpClient.Timeout = TimeSpan.FromSeconds(30);
HttpClient.DefaultRequestHeaders.Add("User-Agent", ProjectRepository); HttpClient.DefaultRequestHeaders.Add("User-Agent", ProjectRepository);

View File

@ -38,6 +38,8 @@ namespace Bloxstrap
private Dictionary<string, PropertyInfo>? _flagMap; private Dictionary<string, PropertyInfo>? _flagMap;
private string? _robloxArg;
// pizzaboxer wanted this // pizzaboxer wanted this
private void ParseLaunchFlagProps() private void ParseLaunchFlagProps()
{ {
@ -76,8 +78,14 @@ namespace Bloxstrap
} }
} }
private void ParseRoblox(string arg, ref int i) // private void ParseRoblox(string arg, ref int i)
public void ParseRoblox()
{ {
string? arg = _robloxArg;
if (arg is null)
return;
if (arg.StartsWith("roblox-player:")) if (arg.StartsWith("roblox-player:"))
{ {
RobloxLaunchArgs = ProtocolHandler.ParseUri(arg); RobloxLaunchArgs = ProtocolHandler.ParseUri(arg);
@ -147,7 +155,8 @@ namespace Bloxstrap
// check & handle roblox arg // check & handle roblox arg
if (!firstArg.StartsWith('-') || firstArg == "-ide") if (!firstArg.StartsWith('-') || firstArg == "-ide")
{ {
ParseRoblox(firstArg, ref idx); // ParseRoblox(firstArg, ref idx);
_robloxArg = firstArg;
idx++; // roblox arg idx++; // roblox arg
} }