1- using System . ComponentModel ;
2- using System . Windows ;
1+ using Bloxstrap . AppData ;
32using Bloxstrap . RobloxInterfaces ;
43
54namespace 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