Skip to content

Commit c22ccd9

Browse files
committed
Fixed channel manager not working
1 parent 0f99fbe commit c22ccd9

File tree

3 files changed

+45
-59
lines changed

3 files changed

+45
-59
lines changed

Bloxstrap/RobloxInterfaces/Deployment.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public static class Deployment
1616

1717
public static string BinaryType = "WindowsPlayer";
1818

19-
public static bool IsDefaultChannel => Channel.Equals(DefaultChannel, StringComparison.OrdinalIgnoreCase);
20-
19+
public static bool IsDefaultChannel => Channel.Equals(DefaultChannel, StringComparison.OrdinalIgnoreCase) || Channel.Equals("live", StringComparison.OrdinalIgnoreCase);
20+
2121
public static string BaseUrl { get; private set; } = null!;
2222

2323
public static readonly List<HttpStatusCode?> BadChannelCodes = new()
@@ -200,7 +200,7 @@ public static async Task<ClientVersion> GetInfo(string ? channel = null)
200200
{
201201
var defaultClientVersion = await GetInfo(DefaultChannel);
202202

203-
if (Utilities.CompareVersions(clientVersion.Version, defaultClientVersion.Version) == VersionComparison.LessThan)
203+
if ((Utilities.CompareVersions(clientVersion.Version, defaultClientVersion.Version) == VersionComparison.LessThan))
204204
clientVersion.IsBehindDefaultChannel = true;
205205
}
206206

Bloxstrap/UI/Elements/Settings/MainWindow.xaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@
2121
Closing="WpfUiWindow_Closing"
2222
Closed="WpfUiWindow_Closed">
2323

24-
<Window.Resources>
25-
<Storyboard x:Key="SpinStoryboard" RepeatBehavior="Forever">
26-
<DoubleAnimation
27-
Storyboard.TargetName="SpinnerRotateTransform"
28-
Storyboard.TargetProperty="Angle"
29-
From="0" To="360"
30-
Duration="0:0:1" />
31-
</Storyboard>
32-
</Window.Resources>
33-
3424
<Grid>
3525
<Grid.RowDefinitions>
3626
<RowDefinition Height="Auto" />

Bloxstrap/UI/ViewModels/Settings/ChannelViewModel.cs

Lines changed: 42 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
using System.ComponentModel;
2-
using System.Windows;
1+
using Bloxstrap.AppData;
32
using Bloxstrap.RobloxInterfaces;
43

54
namespace Bloxstrap.UI.ViewModels.Settings
65
{
7-
86
public class ChannelViewModel : NotifyPropertyChangedViewModel
97
{
108
private string _oldPlayerVersionGuid = "";
@@ -13,51 +11,13 @@ public class ChannelViewModel : NotifyPropertyChangedViewModel
1311
public ChannelViewModel()
1412
{
1513
Task.Run(() => LoadChannelDeployInfo(App.Settings.Prop.Channel));
16-
17-
// Initialize SelectedPriority from settings
18-
_selectedPriority = App.Settings.Prop.SelectedProcessPriority;
1914
}
2015

21-
public new event PropertyChangedEventHandler? PropertyChanged;
22-
private new void OnPropertyChanged(string propertyName) =>
23-
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
24-
2516
public bool UpdateCheckingEnabled
2617
{
2718
get => App.Settings.Prop.CheckForUpdates;
2819
set => App.Settings.Prop.CheckForUpdates = value;
2920
}
30-
public bool DisableAnimations
31-
{
32-
get => App.Settings.Prop.DisableAnimations;
33-
set => App.Settings.Prop.DisableAnimations = value;
34-
}
35-
36-
public bool HardwareAcceleration
37-
{
38-
get => App.Settings.Prop.WPFSoftwareRender;
39-
set => App.Settings.Prop.WPFSoftwareRender = value;
40-
}
41-
42-
43-
private ProcessPriorityOption _selectedPriority;
44-
45-
public IReadOnlyList<ProcessPriorityOption> ProcessPriorityOptions { get; } =
46-
Enum.GetValues(typeof(ProcessPriorityOption)).Cast<ProcessPriorityOption>().ToList();
47-
48-
public ProcessPriorityOption SelectedPriority
49-
{
50-
get => _selectedPriority;
51-
set
52-
{
53-
if (_selectedPriority != value)
54-
{
55-
_selectedPriority = value;
56-
App.Settings.Prop.SelectedProcessPriority = value;
57-
OnPropertyChanged(nameof(SelectedPriority));
58-
}
59-
}
60-
}
6121

6222
private async Task LoadChannelDeployInfo(string channel)
6323
{
@@ -101,9 +61,6 @@ private async Task LoadChannelDeployInfo(string channel)
10161
}
10262
}
10363

104-
public bool IsRobloxInstallationMissing => string.IsNullOrEmpty(App.State.Prop.Player.VersionGuid) &&
105-
string.IsNullOrEmpty(App.State.Prop.Studio.VersionGuid);
106-
10764
public bool ShowLoadingError { get; set; } = false;
10865
public bool ShowChannelWarning { get; set; } = false;
10966

@@ -118,7 +75,14 @@ public string ViewChannel
11875
value = value.Trim();
11976
Task.Run(() => LoadChannelDeployInfo(value));
12077

121-
App.Settings.Prop.Channel = value;
78+
if (value.ToLower() == "live" || value.ToLower() == "zlive")
79+
{
80+
App.Settings.Prop.Channel = Deployment.DefaultChannel;
81+
}
82+
else
83+
{
84+
App.Settings.Prop.Channel = value;
85+
}
12286
}
12387
}
12488

@@ -129,7 +93,7 @@ public string ChannelHash
12993
{
13094
const string VersionHashFormat = "version-(.*)";
13195
Match match = Regex.Match(value, VersionHashFormat);
132-
if (match.Success || string.IsNullOrEmpty(value))
96+
if (match.Success || String.IsNullOrEmpty(value))
13397
{
13498
App.Settings.Prop.ChannelHash = value;
13599
}
@@ -176,5 +140,37 @@ public bool ForceRobloxReinstallation
176140
}
177141
}
178142
}
143+
144+
public bool DisableAnimations
145+
{
146+
get => App.Settings.Prop.DisableAnimations;
147+
set => App.Settings.Prop.DisableAnimations = value;
148+
}
149+
150+
public bool HardwareAcceleration
151+
{
152+
get => App.Settings.Prop.WPFSoftwareRender;
153+
set => App.Settings.Prop.WPFSoftwareRender = value;
154+
}
155+
156+
157+
private ProcessPriorityOption _selectedPriority;
158+
159+
public IReadOnlyList<ProcessPriorityOption> ProcessPriorityOptions { get; } =
160+
Enum.GetValues(typeof(ProcessPriorityOption)).Cast<ProcessPriorityOption>().ToList();
161+
162+
public ProcessPriorityOption SelectedPriority
163+
{
164+
get => _selectedPriority;
165+
set
166+
{
167+
if (_selectedPriority != value)
168+
{
169+
_selectedPriority = value;
170+
App.Settings.Prop.SelectedProcessPriority = value;
171+
OnPropertyChanged(nameof(SelectedPriority));
172+
}
173+
}
174+
}
179175
}
180176
}

0 commit comments

Comments
 (0)