Skip to content

Commit

Permalink
Auto switch to LIVE if using ReShade
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaboxer committed Apr 21, 2023
1 parent 2b8d850 commit 3b7a363
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 8 deletions.
4 changes: 4 additions & 0 deletions Bloxstrap/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using Bloxstrap.Dialogs;
using Bloxstrap.Enums;
using Bloxstrap.Helpers;
using Bloxstrap.Integrations;
using Bloxstrap.Models;
using Bloxstrap.Views;

Expand Down Expand Up @@ -262,6 +263,9 @@ protected override void OnStartup(StartupEventArgs e)

DeployManager.Channel = Settings.Prop.Channel;

if (Settings.Prop.UseReShade)
ReShade.CheckRobloxReleaseChannel().Wait();

// start bootstrapper and show the bootstrapper modal if we're not running silently
Logger.WriteLine($"[App::OnStartup] Initializing bootstrapper");
Bootstrapper bootstrapper = new(commandLine);
Expand Down
2 changes: 1 addition & 1 deletion Bloxstrap/Helpers/DeployManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public async Task<ClientVersion> GetLastDeploy(bool timestamp = false)
{
App.Logger.WriteLine($"[DeployManager::GetLastDeploy] Getting deploy info for channel {Channel} (timestamp={timestamp})");

HttpResponseMessage deployInfoResponse = await App.HttpClient.GetAsync($"https://clientsettings.roblox.com/v2/client-version/WindowsPlayer/channel/{Channel}");
HttpResponseMessage deployInfoResponse = await App.HttpClient.GetAsync($"https://clientsettings.roblox.com/v2/client-version/WindowsPlayer/channel/{Channel}").ConfigureAwait(false);

string rawResponse = await deployInfoResponse.Content.ReadAsStringAsync();

Expand Down
37 changes: 33 additions & 4 deletions Bloxstrap/Integrations/ReShade.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Threading.Tasks;
using Bloxstrap.Helpers;
using System.Windows;

using Bloxstrap.Helpers;
using Bloxstrap.Models;

using IniParser;
Expand Down Expand Up @@ -501,5 +500,35 @@ public static async Task CheckModifications()

SynchronizeConfigFile();
}
}

public static async Task CheckRobloxReleaseChannel()
{
App.Logger.WriteLine($"[ReShade::CheckRobloxReleaseChannel] Checking current Roblox release channel ({App.Settings.Prop.Channel})...");

if (App.Settings.Prop.Channel.ToLower() == DeployManager.DefaultChannel.ToLower())
{
App.Logger.WriteLine($"[App::OnStartup] Channel is already {DeployManager.DefaultChannel}");
return;
}

ClientVersion versionInfo = await App.DeployManager.GetLastDeploy().ConfigureAwait(false);
string manifest = await App.HttpClient.GetStringAsync($"{App.DeployManager.BaseUrl}/{versionInfo.VersionGuid}-rbxManifest.txt");

if (!manifest.Contains("RobloxPlayerBeta.dll"))
return;

MessageBoxResult result = !App.Settings.Prop.PromptChannelChange ? MessageBoxResult.Yes : App.ShowMessageBox(
$"You currently have ReShade enabled, however your current preferred channel ({App.Settings.Prop.Channel}) does not support ReShade. Would you like to switch to {DeployManager.DefaultChannel}? ",
MessageBoxImage.Question,
MessageBoxButton.YesNo
);

if (result != MessageBoxResult.Yes)
return;

App.Logger.WriteLine($"[App::OnStartup] Changed Roblox build channel from {App.Settings.Prop.Channel} to {DeployManager.DefaultChannel}");
App.DeployManager.Channel = App.Settings.Prop.Channel = DeployManager.DefaultChannel;
}

}
}
4 changes: 2 additions & 2 deletions Bloxstrap/Views/Pages/BehaviourPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
<ui:CardControl Margin="0,8,0,0" Padding="16,13,16,12">
<ui:CardControl.Header>
<StackPanel>
<TextBlock FontSize="14" Text="Prompt on Roblox-forced channel change" />
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Bloxstrap will ask you if you want to change the release channel to what Roblox mandates." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
<TextBlock FontSize="14" Text="Prompt on automatic channel change" />
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Bloxstrap may automatically change your preferred release channel. Enabling will ask you before changing." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
</StackPanel>
</ui:CardControl.Header>
<ui:ToggleSwitch IsChecked="{Binding ChannelChangePromptingEnabled, Mode=TwoWay}" />
Expand Down
11 changes: 10 additions & 1 deletion Bloxstrap/Views/Pages/IntegrationsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@
</ui:CardControl>

<TextBlock Text="ReShade" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
<Grid Margin="0,4,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ui:SymbolIcon Grid.Column="0" Margin="0,0,4,0" VerticalAlignment="Center" Symbol="Warning28" FontSize="18" Foreground="{DynamicResource PaletteAmberBrush}" />
<TextBlock Grid.Column="1" VerticalAlignment="Center" Text="Important Notice" FontSize="14" />
</Grid>
<TextBlock Margin="0,4,0,0" Text="As of April 18th, Roblox has started rolling out an update with 64-bit support and the Byfron anticheat. ReShade will not work with this update. If you wish to use ReShade, you will be forced to use the 32-bit version of Roblox that's still currently available. If you wish to use ZWinPlayer64 for 64-bit, you must disable ReShade. This is only temporary, as Roblox may soon merge this update into LIVE." TextWrapping="Wrap" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
<ui:CardControl Margin="0,8,0,0" Padding="16,13,16,12">
<ui:CardControl.Header>
<StackPanel>
Expand Down Expand Up @@ -106,7 +115,7 @@

<TextBlock Text="Custom Integrations" FontSize="16" FontWeight="Medium" Margin="0,16,0,0" />
<TextBlock Margin="0,4,0,0" Text="Here, you can have other programs launch with Roblox automatically." TextWrapping="Wrap" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
<Grid Margin="0,8,0,0">
<Grid Margin="0,8,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
Expand Down

0 comments on commit 3b7a363

Please sign in to comment.