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"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
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"
|
||||
Title="BehaviourPage"
|
||||
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">
|
||||
<ui:CardControl.Header>
|
||||
<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>
|
||||
<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:CardExpander Margin="0,8,0,0" IsExpanded="True">
|
||||
<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>
|
||||
<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>
|
||||
<ui:CardControl Margin="0,8,0,0">
|
||||
<ui:CardControl.Header>
|
||||
<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>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Margin="0,0,16,8" VerticalAlignment="Center" Text="Version" />
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{Binding ChannelDeployInfo.Version, Mode=OneWay}" />
|
||||
<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>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Margin="0,0,16,8" VerticalAlignment="Center" Text="VersionGuid" />
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{Binding ChannelDeployInfo.VersionGuid, Mode=OneWay}" />
|
||||
<ui:CardExpander Margin="0,8,0,0" IsExpanded="True">
|
||||
<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="2" Grid.Column="1" Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{Binding ChannelDeployInfo.Timestamp, Mode=OneWay}" />
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Margin="0,0,16,8" VerticalAlignment="Center" Text="Version" />
|
||||
<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}">
|
||||
<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>
|
||||
<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>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Margin="0,0,16,8" VerticalAlignment="Center" Text="VersionGuid" />
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{Binding ChannelDeployInfo.VersionGuid, Mode=OneWay}" />
|
||||
|
||||
<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>
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Margin="0,0,16,0" VerticalAlignment="Center" Text="Deployed" />
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{Binding ChannelDeployInfo.Timestamp, Mode=OneWay}" />
|
||||
|
||||
<StackPanel Grid.Row="3" Grid.ColumnSpan="2" Margin="0,16,0,0" Orientation="Horizontal">
|
||||
<StackPanel.Style>
|
||||
<Style TargetType="StackPanel">
|
||||
<Setter Property="Visibility" Value="Visible" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ShowChannelWarning, Mode=OneWay}">
|
||||
<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>
|
||||
|
@ -1,4 +1,18 @@
|
||||
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
|
||||
{
|
||||
@ -12,5 +26,10 @@ namespace Bloxstrap.UI.Elements.Menu.Pages
|
||||
DataContext = new BehaviourViewModel();
|
||||
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
|
||||
{
|
||||
public class BehaviourViewModel : NotifyPropertyChangedViewModel
|
||||
{
|
||||
private bool _manualChannelEntry = !RobloxDeployment.SelectableChannels.Contains(App.Settings.Prop.Channel);
|
||||
private string _oldVersionGuid = "";
|
||||
|
||||
public BehaviourViewModel()
|
||||
{
|
||||
@ -16,22 +14,22 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
||||
private async Task LoadChannelDeployInfo(string channel)
|
||||
{
|
||||
const string LOG_IDENT = "BehaviourViewModel::LoadChannelDeployInfo";
|
||||
|
||||
LoadingSpinnerVisibility = Visibility.Visible;
|
||||
LoadingErrorVisibility = Visibility.Collapsed;
|
||||
ChannelInfoLoadingText = "Fetching latest deploy info, please wait...";
|
||||
ChannelDeployInfo = null;
|
||||
|
||||
OnPropertyChanged(nameof(LoadingSpinnerVisibility));
|
||||
OnPropertyChanged(nameof(LoadingErrorVisibility));
|
||||
ShowLoadingError = false;
|
||||
OnPropertyChanged(nameof(ShowLoadingError));
|
||||
|
||||
ChannelInfoLoadingText = "Fetching latest deploy info, please wait...";
|
||||
OnPropertyChanged(nameof(ChannelInfoLoadingText));
|
||||
|
||||
ChannelDeployInfo = null;
|
||||
OnPropertyChanged(nameof(ChannelDeployInfo));
|
||||
|
||||
try
|
||||
{
|
||||
ClientVersion info = await RobloxDeployment.GetInfo(channel, true);
|
||||
|
||||
ChannelWarningVisibility = info.IsBehindDefaultChannel ? Visibility.Visible : Visibility.Collapsed;
|
||||
ShowChannelWarning = info.IsBehindDefaultChannel;
|
||||
OnPropertyChanged(nameof(ShowChannelWarning));
|
||||
|
||||
ChannelDeployInfo = new DeployInfo
|
||||
{
|
||||
@ -40,43 +38,35 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
||||
Timestamp = info.Timestamp?.ToFriendlyString()!
|
||||
};
|
||||
|
||||
OnPropertyChanged(nameof(ChannelWarningVisibility));
|
||||
OnPropertyChanged(nameof(ChannelDeployInfo));
|
||||
}
|
||||
catch (HttpResponseUnsuccessfulException ex)
|
||||
{
|
||||
LoadingSpinnerVisibility = Visibility.Collapsed;
|
||||
LoadingErrorVisibility = Visibility.Visible;
|
||||
ShowLoadingError = true;
|
||||
OnPropertyChanged(nameof(ShowLoadingError));
|
||||
|
||||
ChannelInfoLoadingText = ex.ResponseMessage.StatusCode switch
|
||||
{
|
||||
HttpStatusCode.NotFound => "The specified channel name does not exist.",
|
||||
_ => $"Failed to fetch information! (HTTP {ex.ResponseMessage.StatusCode})",
|
||||
};
|
||||
|
||||
OnPropertyChanged(nameof(LoadingSpinnerVisibility));
|
||||
OnPropertyChanged(nameof(LoadingErrorVisibility));
|
||||
OnPropertyChanged(nameof(ChannelInfoLoadingText));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LoadingSpinnerVisibility = Visibility.Collapsed;
|
||||
LoadingErrorVisibility = Visibility.Visible;
|
||||
|
||||
App.Logger.WriteLine(LOG_IDENT, "An exception occurred while fetching channel information");
|
||||
App.Logger.WriteException(LOG_IDENT, ex);
|
||||
|
||||
ShowLoadingError = true;
|
||||
OnPropertyChanged(nameof(ShowLoadingError));
|
||||
|
||||
ChannelInfoLoadingText = $"Failed to fetch information! ({ex.Message})";
|
||||
|
||||
OnPropertyChanged(nameof(LoadingSpinnerVisibility));
|
||||
OnPropertyChanged(nameof(LoadingErrorVisibility));
|
||||
OnPropertyChanged(nameof(ChannelInfoLoadingText));
|
||||
}
|
||||
}
|
||||
|
||||
public Visibility LoadingSpinnerVisibility { get; private set; } = Visibility.Visible;
|
||||
public Visibility LoadingErrorVisibility { get; private set; } = Visibility.Collapsed;
|
||||
public Visibility ChannelWarningVisibility { get; private set; } = Visibility.Collapsed;
|
||||
public bool ShowLoadingError { get; set; } = false;
|
||||
public bool ShowChannelWarning { get; set; } = false;
|
||||
|
||||
public DeployInfo? ChannelDeployInfo { 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?
|
||||
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;
|
||||
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