Merge pull request #284 from Noggog/under-maintenance

Under maintenance display
This commit is contained in:
Timothy Baldridge 2019-12-17 16:59:16 -07:00 committed by GitHub
commit 4fc9f58d88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 147 additions and 3 deletions

View File

@ -0,0 +1,85 @@
<UserControl
x:Class="Wabbajack.UnderMaintenanceOverlay"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Wabbajack"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="250"
d:DesignWidth="800"
mc:Ignorable="d">
<UserControl.Resources>
<Color x:Key="YellowColor">#fec701</Color>
<SolidColorBrush x:Key="YellowBrush" Color="{StaticResource YellowColor}" />
<Color x:Key="TransparentColor">#99000000</Color>
<SolidColorBrush x:Key="TransparentBrush" Color="{StaticResource TransparentColor}" />
<LinearGradientBrush x:Key="LinesBrush" MappingMode="Absolute" SpreadMethod="Repeat" StartPoint="0,0" EndPoint="48,36">
<GradientStop Offset="0" Color="Black" />
<GradientStop Offset="0.5" Color="{StaticResource TransparentColor}" />
<GradientStop Offset="0.5" Color="{StaticResource YellowColor}" />
<GradientStop Offset="1" Color="{StaticResource YellowColor}" />
</LinearGradientBrush>
</UserControl.Resources>
<Grid Background="{StaticResource TransparentBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Rectangle
Grid.Row="0"
Height="65"
Fill="{StaticResource LinesBrush}">
<Rectangle.Effect>
<DropShadowEffect
BlurRadius="15"
Opacity="0.7"
ShadowDepth="10" />
</Rectangle.Effect>
</Rectangle>
<Viewbox
Grid.Row="1"
Margin="20"
VerticalAlignment="Top">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock
Grid.Row="0"
Grid.Column="1"
FontFamily="Lucida Sans"
FontSize="100"
FontWeight="Bold"
Foreground="{StaticResource YellowBrush}"
Text="UNDER">
<TextBlock.Effect>
<DropShadowEffect
BlurRadius="15"
Opacity="0.7"
ShadowDepth="10" />
</TextBlock.Effect>
</TextBlock>
<TextBlock
Grid.Row="1"
Grid.Column="1"
FontFamily="Lucida Sans"
FontSize="100"
FontWeight="Bold"
Foreground="{StaticResource YellowBrush}"
Text="MAINTENANCE">
<TextBlock.Effect>
<DropShadowEffect
BlurRadius="15"
Opacity="0.7"
ShadowDepth="10" />
</TextBlock.Effect>
</TextBlock>
</Grid>
</Viewbox>
</Grid>
</UserControl>

View File

@ -0,0 +1,28 @@
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 Wabbajack
{
/// <summary>
/// Interaction logic for UnderMaintenanceOverlay.xaml
/// </summary>
public partial class UnderMaintenanceOverlay : UserControl
{
public UnderMaintenanceOverlay()
{
InitializeComponent();
}
}
}

View File

@ -39,7 +39,6 @@ namespace Wabbajack
.SelectTask(async _ =>
{
return (await ModlistMetadata.LoadFromGithub())
.Where(m => !m.ValidationSummary.HasFailures)
.AsObservableChangeSet(x => x.DownloadMetadata?.Hash ?? $"Fallback{missingHashFallbackCounter++}");
})
.Switch()

View File

@ -35,12 +35,18 @@ namespace Wabbajack
[Reactive]
public double ProgressPercent { get; private set; }
[Reactive]
public bool IsBroken { get; private set; }
public ModListMetadataVM(ModListGalleryVM parent, ModlistMetadata metadata)
{
_parent = parent;
Metadata = metadata;
IsBroken = metadata.ValidationSummary.HasFailures;
OpenWebsiteCommand = ReactiveCommand.Create(() => Process.Start($"https://www.wabbajack.org/modlist/{Metadata.Links.MachineURL}"));
ExecuteCommand = ReactiveCommand.CreateFromObservable<Unit, bool>((unit) =>
ExecuteCommand = ReactiveCommand.CreateFromObservable<Unit, bool>(
canExecute: this.WhenAny(x => x.IsBroken).Select(x => !x),
execute: (unit) =>
Observable.Return(unit)
.WithLatestFrom(
this.WhenAny(x => x.Exists),

View File

@ -122,7 +122,21 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="UniformToFill">
<Image Source="{Binding Metadata.Links.ImageUri}" />
<Image Source="{Binding Metadata.Links.ImageUri}">
<Image.Style>
<Style TargetType="Image">
<Style.Triggers>
<DataTrigger Binding="{Binding IsBroken}" Value="True">
<Setter Property="Effect">
<Setter.Value>
<BlurEffect Radius="35" />
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Viewbox>
<Ellipse
Height="120"
@ -164,6 +178,11 @@
</Ellipse>
</Grid>
</Border>
<local:UnderMaintenanceOverlay
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="2"
Visibility="{Binding IsBroken, Converter={StaticResource bool2VisibilityConverter}}" />
<TextBlock
x:Name="DescriptionTextShadow"
Grid.Row="0"

View File

@ -173,6 +173,9 @@
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="Converters\IsTypeVisibilityConverter.cs" />
<Compile Include="UnderMaintenanceOverlay.xaml.cs">
<DependentUpon>UnderMaintenanceOverlay.xaml</DependentUpon>
</Compile>
<Compile Include="View Models\CPUDisplayVM.cs" />
<Compile Include="Views\Compilers\CompilationCompleteView.xaml.cs">
<DependentUpon>CompilationCompleteView.xaml</DependentUpon>
@ -270,6 +273,10 @@
<Compile Include="Views\WebBrowserView.xaml.cs">
<DependentUpon>WebBrowserView.xaml</DependentUpon>
</Compile>
<Page Include="UnderMaintenanceOverlay.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Compilers\CompilationCompleteView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>