mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-05-15 12:44:41 -07:00
Add option to force reinstall Roblox, cleanup VM
This commit is contained in:
parent
b651be7024
commit
3c6f7a1127
@ -1,118 +1,180 @@
|
|||||||
<ui:UiPage x:Class="Bloxstrap.UI.Elements.Menu.Pages.BehaviourPage"
|
<ui:UiPage x:Class="Bloxstrap.UI.Elements.Menu.Pages.BehaviourPage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||||
mc:Ignorable="d"
|
xmlns:local="clr-namespace:Bloxstrap.UI.Elements.Menu.Pages"
|
||||||
|
xmlns:models="clr-namespace:Bloxstrap.UI.ViewModels.Menu"
|
||||||
|
d:DataContext="{d:DesignInstance Type=models:BehaviourViewModel}"
|
||||||
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="600" d:DesignWidth="800"
|
d:DesignHeight="600" d:DesignWidth="800"
|
||||||
Title="BehaviourPage"
|
Title="BehaviourPage"
|
||||||
Scrollable="True">
|
Scrollable="True">
|
||||||
<StackPanel Margin="0,0,14,14">
|
|
||||||
<TextBlock Margin="0,0,0,8" Text="Configure what Bloxstrap should do when launching." FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
|
||||||
|
|
||||||
<ui:CardControl Margin="0,8,0,0">
|
<StackPanel Margin="0,0,14,14">
|
||||||
<ui:CardControl.Header>
|
<TextBlock Margin="0,0,0,8" Text="Configure what Bloxstrap should do when launching." FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||||
<StackPanel>
|
|
||||||
<TextBlock FontSize="14" Text="Create desktop icon" />
|
|
||||||
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Bloxstrap will place an icon on the desktop that launches Roblox the next time it launches." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
|
|
||||||
</StackPanel>
|
|
||||||
</ui:CardControl.Header>
|
|
||||||
<ui:ToggleSwitch IsChecked="{Binding CreateDesktopIcon, Mode=TwoWay}" />
|
|
||||||
</ui:CardControl>
|
|
||||||
|
|
||||||
<ui:CardControl Margin="0,8,0,0">
|
|
||||||
<ui:CardControl.Header>
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock FontSize="14" Text="Automatically update Bloxstrap" />
|
|
||||||
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Bloxstrap will automatically check and update itself when launching Roblox." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
|
|
||||||
</StackPanel>
|
|
||||||
</ui:CardControl.Header>
|
|
||||||
<ui:ToggleSwitch IsChecked="{Binding UpdateCheckingEnabled, Mode=TwoWay}" />
|
|
||||||
</ui:CardControl>
|
|
||||||
|
|
||||||
<ui:CardExpander Margin="0,8,0,0" IsExpanded="True">
|
<ui:CardControl Margin="0,8,0,0">
|
||||||
<ui:CardExpander.Header>
|
<ui:CardControl.Header>
|
||||||
<Grid>
|
<StackPanel>
|
||||||
<Grid.ColumnDefinitions>
|
<TextBlock FontSize="14" Text="Create desktop icon" />
|
||||||
<ColumnDefinition Width="*" />
|
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Bloxstrap will place an icon on the desktop that launches Roblox the next time it launches." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
|
||||||
<ColumnDefinition Width="Auto" />
|
</StackPanel>
|
||||||
</Grid.ColumnDefinitions>
|
</ui:CardControl.Header>
|
||||||
<StackPanel Grid.Column="0">
|
<ui:ToggleSwitch IsChecked="{Binding CreateDesktopIcon, Mode=TwoWay}" />
|
||||||
<TextBlock FontSize="14" Text="Channel" />
|
</ui:CardControl>
|
||||||
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Choose which deployment channel Roblox should be downloaded from." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
|
|
||||||
</StackPanel>
|
|
||||||
<ComboBox Grid.Column="1" Margin="8,0,8,0" Padding="10,5,10,5" Width="200" IsEditable="True" ItemsSource="{Binding Channels, Mode=OneWay}" Text="{Binding SelectedChannel, Mode=TwoWay, Delay=250}" />
|
|
||||||
</Grid>
|
|
||||||
</ui:CardExpander.Header>
|
|
||||||
<StackPanel>
|
|
||||||
<Grid Margin="0,0,4,0">
|
|
||||||
<Grid.Style>
|
|
||||||
<Style>
|
|
||||||
<Setter Property="Grid.Visibility" Value="Visible"/>
|
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding ChannelDeployInfo}" Value="{x:Null}">
|
|
||||||
<Setter Property="Grid.Visibility" Value="Collapsed" />
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</Grid.Style>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="0" Grid.Column="0" Margin="0,0,16,8" VerticalAlignment="Center" Text="Version" />
|
<ui:CardControl Margin="0,8,0,0">
|
||||||
<TextBlock Grid.Row="0" Grid.Column="1" Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{Binding ChannelDeployInfo.Version, Mode=OneWay}" />
|
<ui:CardControl.Header>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock FontSize="14" Text="Automatically update Bloxstrap" />
|
||||||
|
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Bloxstrap will automatically check and update itself when launching Roblox." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
|
||||||
|
</StackPanel>
|
||||||
|
</ui:CardControl.Header>
|
||||||
|
<ui:ToggleSwitch IsChecked="{Binding UpdateCheckingEnabled, Mode=TwoWay}" />
|
||||||
|
</ui:CardControl>
|
||||||
|
|
||||||
<TextBlock Grid.Row="1" Grid.Column="0" Margin="0,0,16,8" VerticalAlignment="Center" Text="VersionGuid" />
|
<ui:CardExpander Margin="0,8,0,0" IsExpanded="True">
|
||||||
<TextBlock Grid.Row="1" Grid.Column="1" Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{Binding ChannelDeployInfo.VersionGuid, Mode=OneWay}" />
|
<ui:CardExpander.Header>
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel Grid.Column="0">
|
||||||
|
<TextBlock FontSize="14" Text="Channel" />
|
||||||
|
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Choose which deployment channel Roblox should be downloaded from." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
|
||||||
|
</StackPanel>
|
||||||
|
<ComboBox Grid.Column="1" Margin="8,0,8,0" Padding="10,5,10,5" Width="200" IsEditable="True" ItemsSource="{Binding Channels, Mode=OneWay}" Text="{Binding SelectedChannel, Mode=TwoWay, Delay=250}" />
|
||||||
|
</Grid>
|
||||||
|
</ui:CardExpander.Header>
|
||||||
|
|
||||||
|
<StackPanel>
|
||||||
|
<Grid Margin="0,0,4,0">
|
||||||
|
<Grid.Style>
|
||||||
|
<Style TargetType="Grid">
|
||||||
|
<Setter Property="Visibility" Value="Visible"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding ChannelDeployInfo}" Value="{x:Null}">
|
||||||
|
<Setter Property="Visibility" Value="Collapsed" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Grid.Style>
|
||||||
|
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBlock Grid.Row="2" Grid.Column="0" Margin="0,0,16,0" VerticalAlignment="Center" Text="Deployed" />
|
<TextBlock Grid.Row="0" Grid.Column="0" Margin="0,0,16,8" VerticalAlignment="Center" Text="Version" />
|
||||||
<TextBlock Grid.Row="2" Grid.Column="1" Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{Binding ChannelDeployInfo.Timestamp, Mode=OneWay}" />
|
<TextBlock Grid.Row="0" Grid.Column="1" Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{Binding ChannelDeployInfo.Version, Mode=OneWay}" />
|
||||||
|
|
||||||
<StackPanel Grid.Row="3" Grid.ColumnSpan="2" Margin="0,16,0,0" Orientation="Horizontal" Visibility="{Binding ChannelWarningVisibility, Mode=OneWay}">
|
<TextBlock Grid.Row="1" Grid.Column="0" Margin="0,0,16,8" VerticalAlignment="Center" Text="VersionGuid" />
|
||||||
<Image Grid.Column="0" Width="24" Height="24" RenderOptions.BitmapScalingMode="HighQuality" Source="pack://application:,,,/Resources/MessageBox/Warning.png" />
|
<TextBlock Grid.Row="1" Grid.Column="1" Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{Binding ChannelDeployInfo.VersionGuid, Mode=OneWay}" />
|
||||||
<TextBlock Margin="8,0,0,0" VerticalAlignment="Center" Text="This channel is out of date, and is likely no longer being updated. Please use another channel." />
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
<Grid Column="0">
|
|
||||||
<Grid.Style>
|
|
||||||
<Style>
|
|
||||||
<Setter Property="Grid.Visibility" Value="Collapsed"/>
|
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding ChannelDeployInfo}" Value="{x:Null}">
|
|
||||||
<Setter Property="Grid.Visibility" Value="Visible" />
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</Grid.Style>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<ui:ProgressRing Grid.Column="0" Margin="6" IsIndeterminate="True" Visibility="{Binding LoadingSpinnerVisibility, Mode=OneWay}" />
|
|
||||||
<Image Grid.Column="0" Margin="6" Width="60" Height="60" Visibility="{Binding LoadingErrorVisibility, Mode=OneWay}" RenderOptions.BitmapScalingMode="HighQuality" Source="pack://application:,,,/Resources/MessageBox/Error.png" />
|
|
||||||
|
|
||||||
<TextBlock Grid.Column="1" Margin="16" VerticalAlignment="Center" Text="{Binding ChannelInfoLoadingText, Mode=OneWay}" TextWrapping="Wrap" />
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
</ui:CardExpander>
|
|
||||||
|
|
||||||
<ui:CardControl Margin="0,8,0,0">
|
<TextBlock Grid.Row="2" Grid.Column="0" Margin="0,0,16,0" VerticalAlignment="Center" Text="Deployed" />
|
||||||
<ui:CardControl.Header>
|
<TextBlock Grid.Row="2" Grid.Column="1" Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{Binding ChannelDeployInfo.Timestamp, Mode=OneWay}" />
|
||||||
<StackPanel>
|
|
||||||
<TextBlock FontSize="14" Text="Automatic channel change action" />
|
<StackPanel Grid.Row="3" Grid.ColumnSpan="2" Margin="0,16,0,0" Orientation="Horizontal">
|
||||||
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Roblox or Bloxstrap may try to change your preferred channel." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
|
<StackPanel.Style>
|
||||||
</StackPanel>
|
<Style TargetType="StackPanel">
|
||||||
</ui:CardControl.Header>
|
<Setter Property="Visibility" Value="Visible" />
|
||||||
<ComboBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" ItemsSource="{Binding ChannelChangeModes.Keys, Mode=OneTime}" Text="{Binding SelectedChannelChangeMode, Mode=TwoWay}" />
|
<Style.Triggers>
|
||||||
</ui:CardControl>
|
<DataTrigger Binding="{Binding ShowChannelWarning, Mode=OneWay}">
|
||||||
</StackPanel>
|
<Setter Property="Visibility" Value="Collapsed" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</StackPanel.Style>
|
||||||
|
<Image Grid.Column="0" Width="24" Height="24" RenderOptions.BitmapScalingMode="HighQuality" Source="pack://application:,,,/Resources/MessageBox/Warning.png" />
|
||||||
|
<TextBlock Margin="8,0,0,0" VerticalAlignment="Center" Text="This channel is out of date, and is likely no longer being updated. Please use another channel." />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid Column="0">
|
||||||
|
<Grid.Style>
|
||||||
|
<Style TargetType="Grid">
|
||||||
|
<Setter Property="Visibility" Value="Collapsed" />
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding ChannelDeployInfo}" Value="{x:Null}">
|
||||||
|
<Setter Property="Visibility" Value="Visible" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Grid.Style>
|
||||||
|
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<ui:ProgressRing Grid.Column="0" Margin="6" IsIndeterminate="True">
|
||||||
|
<ui:ProgressRing.Style>
|
||||||
|
<Style TargetType="ui:ProgressRing" BasedOn="{StaticResource {x:Type ui:ProgressRing}}">
|
||||||
|
<Setter Property="Visibility" Value="Visible" />
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding ShowLoadingError, Mode=OneWay}" Value="True">
|
||||||
|
<Setter Property="Visibility" Value="Collapsed" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</ui:ProgressRing.Style>
|
||||||
|
</ui:ProgressRing>
|
||||||
|
|
||||||
|
<Image Grid.Column="0" Margin="6" Width="60" Height="60" RenderOptions.BitmapScalingMode="HighQuality" Source="pack://application:,,,/Resources/MessageBox/Error.png">
|
||||||
|
<Image.Style>
|
||||||
|
<Style TargetType="Image">
|
||||||
|
<Setter Property="Visibility" Value="Collapsed" />
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding ShowLoadingError, Mode=OneWay}" Value="True">
|
||||||
|
<Setter Property="Visibility" Value="Visible" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Image.Style>
|
||||||
|
</Image>
|
||||||
|
|
||||||
|
<TextBlock Grid.Column="1" Margin="16" VerticalAlignment="Center" Text="{Binding ChannelInfoLoadingText, Mode=OneWay}" TextWrapping="Wrap" />
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
|
</ui:CardExpander>
|
||||||
|
|
||||||
|
<ui:CardControl Margin="0,8,0,0">
|
||||||
|
<ui:CardControl.Header>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock FontSize="14" Text="Automatic channel change action" />
|
||||||
|
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Roblox or Bloxstrap may try to change your preferred channel." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
|
||||||
|
</StackPanel>
|
||||||
|
</ui:CardControl.Header>
|
||||||
|
<ComboBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" ItemsSource="{Binding ChannelChangeModes.Keys, Mode=OneTime}" Text="{Binding SelectedChannelChangeMode, Mode=TwoWay}" />
|
||||||
|
</ui:CardControl>
|
||||||
|
|
||||||
|
<ui:CardControl Margin="0,8,0,0">
|
||||||
|
<ui:CardControl.Style>
|
||||||
|
<Style TargetType="ui:CardControl" BasedOn="{StaticResource {x:Type ui:CardControl}}">
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding ForceRobloxReinstallation, Mode=OneTime}" Value="True">
|
||||||
|
<Setter Property="IsEnabled" Value="False" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</ui:CardControl.Style>
|
||||||
|
<ui:CardControl.Header>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock FontSize="14" Text="Force Roblox reinstallation" />
|
||||||
|
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Roblox will be installed fresh on next launch." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
|
||||||
|
</StackPanel>
|
||||||
|
</ui:CardControl.Header>
|
||||||
|
<ui:ToggleSwitch IsChecked="{Binding ForceRobloxReinstallation, Mode=TwoWay}" />
|
||||||
|
</ui:CardControl>
|
||||||
|
</StackPanel>
|
||||||
</ui:UiPage>
|
</ui:UiPage>
|
||||||
|
@ -1,4 +1,18 @@
|
|||||||
using Bloxstrap.UI.ViewModels.Menu;
|
using Bloxstrap.UI.ViewModels.Menu;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
namespace Bloxstrap.UI.Elements.Menu.Pages
|
namespace Bloxstrap.UI.Elements.Menu.Pages
|
||||||
{
|
{
|
||||||
@ -12,5 +26,10 @@ namespace Bloxstrap.UI.Elements.Menu.Pages
|
|||||||
DataContext = new BehaviourViewModel();
|
DataContext = new BehaviourViewModel();
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ToggleSwitch_Checked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
using System.Windows;
|
using Bloxstrap.Exceptions;
|
||||||
|
|
||||||
using Bloxstrap.Exceptions;
|
|
||||||
|
|
||||||
namespace Bloxstrap.UI.ViewModels.Menu
|
namespace Bloxstrap.UI.ViewModels.Menu
|
||||||
{
|
{
|
||||||
public class BehaviourViewModel : NotifyPropertyChangedViewModel
|
public class BehaviourViewModel : NotifyPropertyChangedViewModel
|
||||||
{
|
{
|
||||||
private bool _manualChannelEntry = !RobloxDeployment.SelectableChannels.Contains(App.Settings.Prop.Channel);
|
private string _oldVersionGuid = "";
|
||||||
|
|
||||||
public BehaviourViewModel()
|
public BehaviourViewModel()
|
||||||
{
|
{
|
||||||
@ -16,22 +14,22 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
|||||||
private async Task LoadChannelDeployInfo(string channel)
|
private async Task LoadChannelDeployInfo(string channel)
|
||||||
{
|
{
|
||||||
const string LOG_IDENT = "BehaviourViewModel::LoadChannelDeployInfo";
|
const string LOG_IDENT = "BehaviourViewModel::LoadChannelDeployInfo";
|
||||||
|
|
||||||
LoadingSpinnerVisibility = Visibility.Visible;
|
|
||||||
LoadingErrorVisibility = Visibility.Collapsed;
|
|
||||||
ChannelInfoLoadingText = "Fetching latest deploy info, please wait...";
|
|
||||||
ChannelDeployInfo = null;
|
|
||||||
|
|
||||||
OnPropertyChanged(nameof(LoadingSpinnerVisibility));
|
ShowLoadingError = false;
|
||||||
OnPropertyChanged(nameof(LoadingErrorVisibility));
|
OnPropertyChanged(nameof(ShowLoadingError));
|
||||||
|
|
||||||
|
ChannelInfoLoadingText = "Fetching latest deploy info, please wait...";
|
||||||
OnPropertyChanged(nameof(ChannelInfoLoadingText));
|
OnPropertyChanged(nameof(ChannelInfoLoadingText));
|
||||||
|
|
||||||
|
ChannelDeployInfo = null;
|
||||||
OnPropertyChanged(nameof(ChannelDeployInfo));
|
OnPropertyChanged(nameof(ChannelDeployInfo));
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ClientVersion info = await RobloxDeployment.GetInfo(channel, true);
|
ClientVersion info = await RobloxDeployment.GetInfo(channel, true);
|
||||||
|
|
||||||
ChannelWarningVisibility = info.IsBehindDefaultChannel ? Visibility.Visible : Visibility.Collapsed;
|
ShowChannelWarning = info.IsBehindDefaultChannel;
|
||||||
|
OnPropertyChanged(nameof(ShowChannelWarning));
|
||||||
|
|
||||||
ChannelDeployInfo = new DeployInfo
|
ChannelDeployInfo = new DeployInfo
|
||||||
{
|
{
|
||||||
@ -40,43 +38,35 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
|||||||
Timestamp = info.Timestamp?.ToFriendlyString()!
|
Timestamp = info.Timestamp?.ToFriendlyString()!
|
||||||
};
|
};
|
||||||
|
|
||||||
OnPropertyChanged(nameof(ChannelWarningVisibility));
|
|
||||||
OnPropertyChanged(nameof(ChannelDeployInfo));
|
OnPropertyChanged(nameof(ChannelDeployInfo));
|
||||||
}
|
}
|
||||||
catch (HttpResponseUnsuccessfulException ex)
|
catch (HttpResponseUnsuccessfulException ex)
|
||||||
{
|
{
|
||||||
LoadingSpinnerVisibility = Visibility.Collapsed;
|
ShowLoadingError = true;
|
||||||
LoadingErrorVisibility = Visibility.Visible;
|
OnPropertyChanged(nameof(ShowLoadingError));
|
||||||
|
|
||||||
ChannelInfoLoadingText = ex.ResponseMessage.StatusCode switch
|
ChannelInfoLoadingText = ex.ResponseMessage.StatusCode switch
|
||||||
{
|
{
|
||||||
HttpStatusCode.NotFound => "The specified channel name does not exist.",
|
HttpStatusCode.NotFound => "The specified channel name does not exist.",
|
||||||
_ => $"Failed to fetch information! (HTTP {ex.ResponseMessage.StatusCode})",
|
_ => $"Failed to fetch information! (HTTP {ex.ResponseMessage.StatusCode})",
|
||||||
};
|
};
|
||||||
|
|
||||||
OnPropertyChanged(nameof(LoadingSpinnerVisibility));
|
|
||||||
OnPropertyChanged(nameof(LoadingErrorVisibility));
|
|
||||||
OnPropertyChanged(nameof(ChannelInfoLoadingText));
|
OnPropertyChanged(nameof(ChannelInfoLoadingText));
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LoadingSpinnerVisibility = Visibility.Collapsed;
|
|
||||||
LoadingErrorVisibility = Visibility.Visible;
|
|
||||||
|
|
||||||
App.Logger.WriteLine(LOG_IDENT, "An exception occurred while fetching channel information");
|
App.Logger.WriteLine(LOG_IDENT, "An exception occurred while fetching channel information");
|
||||||
App.Logger.WriteException(LOG_IDENT, ex);
|
App.Logger.WriteException(LOG_IDENT, ex);
|
||||||
|
|
||||||
|
ShowLoadingError = true;
|
||||||
|
OnPropertyChanged(nameof(ShowLoadingError));
|
||||||
|
|
||||||
ChannelInfoLoadingText = $"Failed to fetch information! ({ex.Message})";
|
ChannelInfoLoadingText = $"Failed to fetch information! ({ex.Message})";
|
||||||
|
|
||||||
OnPropertyChanged(nameof(LoadingSpinnerVisibility));
|
|
||||||
OnPropertyChanged(nameof(LoadingErrorVisibility));
|
|
||||||
OnPropertyChanged(nameof(ChannelInfoLoadingText));
|
OnPropertyChanged(nameof(ChannelInfoLoadingText));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Visibility LoadingSpinnerVisibility { get; private set; } = Visibility.Visible;
|
public bool ShowLoadingError { get; set; } = false;
|
||||||
public Visibility LoadingErrorVisibility { get; private set; } = Visibility.Collapsed;
|
public bool ShowChannelWarning { get; set; } = false;
|
||||||
public Visibility ChannelWarningVisibility { get; private set; } = Visibility.Collapsed;
|
|
||||||
|
|
||||||
public DeployInfo? ChannelDeployInfo { get; private set; } = null;
|
public DeployInfo? ChannelDeployInfo { get; private set; } = null;
|
||||||
public string ChannelInfoLoadingText { get; private set; } = null!;
|
public string ChannelInfoLoadingText { get; private set; } = null!;
|
||||||
@ -110,24 +100,6 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ManualChannelEntry
|
|
||||||
{
|
|
||||||
get => _manualChannelEntry;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_manualChannelEntry = value;
|
|
||||||
|
|
||||||
if (!value)
|
|
||||||
{
|
|
||||||
// roblox typically sets channels in all lowercase, so here we find if a case insensitive match exists
|
|
||||||
string? matchingChannel = Channels.Where(x => x.ToLowerInvariant() == SelectedChannel.ToLowerInvariant()).FirstOrDefault();
|
|
||||||
SelectedChannel = string.IsNullOrEmpty(matchingChannel) ? RobloxDeployment.DefaultChannel : matchingChannel;
|
|
||||||
}
|
|
||||||
|
|
||||||
OnPropertyChanged(nameof(SelectedChannel));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// todo - move to enum attributes?
|
// todo - move to enum attributes?
|
||||||
public IReadOnlyDictionary<string, ChannelChangeMode> ChannelChangeModes => new Dictionary<string, ChannelChangeMode>
|
public IReadOnlyDictionary<string, ChannelChangeMode> ChannelChangeModes => new Dictionary<string, ChannelChangeMode>
|
||||||
{
|
{
|
||||||
@ -141,5 +113,22 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
|||||||
get => ChannelChangeModes.FirstOrDefault(x => x.Value == App.Settings.Prop.ChannelChangeMode).Key;
|
get => ChannelChangeModes.FirstOrDefault(x => x.Value == App.Settings.Prop.ChannelChangeMode).Key;
|
||||||
set => App.Settings.Prop.ChannelChangeMode = ChannelChangeModes[value];
|
set => App.Settings.Prop.ChannelChangeMode = ChannelChangeModes[value];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool ForceRobloxReinstallation
|
||||||
|
{
|
||||||
|
get => String.IsNullOrEmpty(App.State.Prop.VersionGuid);
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
_oldVersionGuid = App.State.Prop.VersionGuid;
|
||||||
|
App.State.Prop.VersionGuid = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
App.State.Prop.VersionGuid = _oldVersionGuid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user