Skip to content

Commit

Permalink
Merge branch 'pizzaboxer:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Roblox-Thot authored Jun 14, 2024
2 parents 5739bfb + b84522a commit 3c19646
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 52 deletions.
10 changes: 2 additions & 8 deletions Bloxstrap/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,15 @@ protected override async void OnStartup(StartupEventArgs e)
FastFlags.Load();
}

LaunchSettings.ParseRoblox();

HttpClient.Timeout = TimeSpan.FromSeconds(30);
HttpClient.DefaultRequestHeaders.Add("User-Agent", ProjectRepository);

// TEMPORARY FILL-IN FOR NEW FUNCTIONALITY
// REMOVE WHEN LARGER REFACTORING IS DONE
await RobloxDeployment.InitializeConnectivity();

// disallow running as administrator except for uninstallation
if (Utilities.IsAdministrator && !LaunchSettings.IsUninstall)
{
Frontend.ShowMessageBox(Bloxstrap.Resources.Strings.Bootstrapper_RanInAdminMode, MessageBoxImage.Error);
Terminate(ErrorCode.ERROR_INVALID_FUNCTION);
return;
}

if (LaunchSettings.IsUninstall && IsFirstRun)
{
Frontend.ShowMessageBox(Bloxstrap.Resources.Strings.Bootstrapper_FirstRunUninstall, MessageBoxImage.Error);
Expand Down
9 changes: 5 additions & 4 deletions Bloxstrap/Bloxstrap.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
Expand All @@ -7,10 +7,11 @@
<UseWPF>true</UseWPF>
<UseWindowsForms>True</UseWindowsForms>
<ApplicationIcon>Bloxstrap.ico</ApplicationIcon>
<Version>2.6.0</Version>
<FileVersion>2.6.0.0</FileVersion>
<Version>2.6.1</Version>
<FileVersion>2.6.1.0</FileVersion>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Bloxstrap/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@ private async Task CheckLatestVersion()
}
catch (HttpResponseException ex)
{
if (ex.ResponseMessage.StatusCode != HttpStatusCode.NotFound)
if (ex.ResponseMessage.StatusCode is not HttpStatusCode.Unauthorized and not HttpStatusCode.Forbidden and not HttpStatusCode.NotFound)
throw;

App.Logger.WriteLine(LOG_IDENT, $"Reverting enrolled channel to {RobloxDeployment.DefaultChannel} because a {binaryType} build does not exist for {App.Settings.Prop.Channel}");
App.Logger.WriteLine(LOG_IDENT, $"Reverting enrolled channel to {RobloxDeployment.DefaultChannel} because HTTP {(int)ex.ResponseMessage.StatusCode}");
App.Settings.Prop.Channel = RobloxDeployment.DefaultChannel;
clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel, binaryType: binaryType);
}
Expand Down
17 changes: 0 additions & 17 deletions Bloxstrap/FastFlagManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,23 +245,6 @@ public override void Load()
string? val = GetPreset("UI.Menu.Style.EnableV4.1");
if (GetPreset("UI.Menu.Style.EnableV4.2") != val)
SetPreset("UI.Menu.Style.EnableV4.2", val);

if (GetPreset("Rendering.Framerate") is not null)
return;

// set it to be the framerate of the primary display by default

var screen = Screen.AllScreens.Where(x => x.Primary).Single();
var devmode = new DEVMODEW();

PInvoke.EnumDisplaySettings(screen.DeviceName, ENUM_DISPLAY_SETTINGS_MODE.ENUM_CURRENT_SETTINGS, ref devmode);

uint framerate = devmode.dmDisplayFrequency;

if (framerate <= 100)
framerate *= 2;

SetPreset("Rendering.Framerate", framerate);
}
}
}
11 changes: 9 additions & 2 deletions Bloxstrap/InstallChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ internal static void CheckUpgrade()

// update migrations

if (App.BuildMetadata.CommitRef.StartsWith("tag"))
if (App.BuildMetadata.CommitRef.StartsWith("tag") && currentVersionInfo.ProductVersion is not null)
{
if (existingVersionInfo.ProductVersion == "2.4.0")
{
Expand All @@ -227,7 +227,7 @@ internal static void CheckUpgrade()

App.FastFlags.Save();
}
else if (currentVersionInfo.ProductVersion == "2.6.0")
else if (existingVersionInfo.ProductVersion == "2.5.4")
{
if (App.Settings.Prop.UseDisableAppPatch)
{
Expand All @@ -246,6 +246,13 @@ internal static void CheckUpgrade()
if (App.Settings.Prop.BootstrapperStyle == BootstrapperStyle.ClassicFluentDialog)
App.Settings.Prop.BootstrapperStyle = BootstrapperStyle.FluentDialog;

_ = int.TryParse(App.FastFlags.GetPreset("Rendering.Framerate"), out int x);
if (x == 0)
{
App.FastFlags.SetPreset("Rendering.Framerate", null);
App.FastFlags.Save();
}

App.Settings.Save();
}
}
Expand Down
13 changes: 11 additions & 2 deletions Bloxstrap/LaunchSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public class LaunchSettings
public string[] Args { get; private set; }

private Dictionary<string, PropertyInfo>? _flagMap;

private string? _robloxArg;

// pizzaboxer wanted this
private void ParseLaunchFlagProps()
Expand Down Expand Up @@ -76,8 +78,14 @@ private void ParseFlag(string arg)
}
}

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:"))
{
RobloxLaunchArgs = ProtocolHandler.ParseUri(arg);
Expand Down Expand Up @@ -145,7 +153,8 @@ private void Parse()
// check & handle roblox arg
if (!firstArg.StartsWith('-') || firstArg == "-ide")
{
ParseRoblox(firstArg, ref idx);
// ParseRoblox(firstArg, ref idx);
_robloxArg = firstArg;
idx++; // roblox arg
}

Expand Down
9 changes: 0 additions & 9 deletions Bloxstrap/Resources/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Bloxstrap/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ Your ReShade configuration files will still be saved, and you can locate them by
<data name="Bootstrapper.NotEnoughSpace" xml:space="preserve">
<value>Bloxstrap does not have enough disk space to download and install Roblox. Please free up some disk space and try again.</value>
</data>
<data name="Bootstrapper.RanInAdminMode" xml:space="preserve">
<value>Bloxstrap does not support running in administrator mode. Relaunch or reinstall Bloxstrap with lower privileges.</value>
</data>
<data name="Bootstrapper.Status.ApplyingModifications" xml:space="preserve">
<value>Applying Roblox modifications...</value>
</data>
Expand Down
6 changes: 3 additions & 3 deletions Bloxstrap/UI/Elements/Menu/Pages/AboutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@
</StackPanel>
</controls:Expander>

<controls:Expander Grid.Column="2" Margin="4,0,4,0" HeaderIcon="Translate24" HeaderText="{x:Static resources:Strings.Menu_About_Contributors_Translations}">
<!--<controls:Expander Grid.Column="2" Margin="4,0,4,0" HeaderIcon="Translate24" HeaderText="{x:Static resources:Strings.Menu_About_Contributors_Translations}">
<StackPanel>
<TextBlock Text="lol" />
</StackPanel>
</controls:Expander>
</controls:Expander>-->

<controls:Expander Grid.Column="3" Margin="4,0,0,0" HeaderIcon="Heart16" HeaderText="{x:Static resources:Strings.Menu_About_Contributors_SpecialThanks}">
<controls:Expander Grid.Column="2" Margin="4,0,0,0" HeaderIcon="Heart16" HeaderText="{x:Static resources:Strings.Menu_About_Contributors_SpecialThanks}">
<StackPanel>
<controls:MarkdownTextBlock MarkdownText="[MaximumADHD](https://github.com/MaximumADHD)" />
<controls:MarkdownTextBlock MarkdownText="[Multako](https://www.roblox.com/users/2485612194/profile)" />
Expand Down
4 changes: 2 additions & 2 deletions Bloxstrap/UI/ViewModels/Menu/FastFlagsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public string StateOverlayFlags

public int FramerateLimit
{
get => int.TryParse(App.FastFlags.GetPreset("Rendering.Framerate"), out int x) ? x : 60;
set => App.FastFlags.SetPreset("Rendering.Framerate", value);
get => int.TryParse(App.FastFlags.GetPreset("Rendering.Framerate"), out int x) ? x : 0;
set => App.FastFlags.SetPreset("Rendering.Framerate", value == 0 ? null : value);
}

public IReadOnlyDictionary<RenderingMode, string> RenderingModes => FastFlagManager.RenderingModes;
Expand Down

0 comments on commit 3c19646

Please sign in to comment.