fix/no-patch-folder-check #4

Merged
waffle.lord merged 3 commits from fix/no-patch-folder-check into main 2022-04-30 12:14:22 -04:00
6 changed files with 43 additions and 68 deletions

View File

@ -4,15 +4,16 @@
<Design.PreviewWith>
<Border Padding="20" Background="{StaticResource AKI_Background_Light}">
<!-- Add Controls for Previewer Here -->
<StackPanel Background="{StaticResource AKI_Background_Light}" Spacing="15" Margin="10">
<cc:TitleBar Title="Title Bar Text"/>
<Label Content="Normal label"/>
<Label Content="Yellow label" Classes="yellow"/>
<Label Content="Blue label" Classes="dark"/>
<ProgressBar Value="40"/>
<Separator Height="1"/>
<ProgressBar Value="60" Classes="done"/>
</StackPanel>
<StackPanel Background="{StaticResource AKI_Background_Light}" Spacing="15" Margin="10">
<cc:TitleBar Title="Title Bar Text"/>
<Label Content="Normal label"/>
<Label Content="Yellow label" Classes="yellow"/>
<TextBlock Text="Yellow textblock" Classes="yellow"/>
<Label Content="Blue label" Classes="dark"/>
<ProgressBar Value="40"/>
<Separator Height="1"/>
<ProgressBar Value="60" Classes="done"/>
</StackPanel>
</Border>
</Design.PreviewWith>
@ -21,24 +22,28 @@
<Style Selector="cc|TitleBar">
<Setter Property="Background" Value="{StaticResource AKI_Background_Dark}"/>
<Setter Property="Foreground" Value="{StaticResource AKI_Foreground_Light}"/>
<Setter Property="XButtonForeground" Value="{StaticResource AKI_Brush_DarkGrayBlue}"/>
<Setter Property="XButtonForeground" Value="{StaticResource AKI_Brush_DarkGrayBlue}"/>
</Style>
<Style Selector="Label">
<Setter Property="Foreground" Value="{StaticResource AKI_Foreground_Light}"/>
</Style>
<Style Selector="TextBlock.yellow">
<Setter Property="Foreground" Value="{StaticResource AKI_Brush_Yellow}"/>
</Style>
<Style Selector="Label">
<Setter Property="Foreground" Value="{StaticResource AKI_Foreground_Light}"/>
</Style>
<Style Selector="Label.yellow">
<Setter Property="Foreground" Value="{StaticResource AKI_Brush_Yellow}"/>
</Style>
<Style Selector="Label.dark">
<Setter Property="Foreground" Value="DimGray"/>
</Style>
<Style Selector="Label.dark">
<Setter Property="Foreground" Value="DimGray"/>
</Style>
<Style Selector="ProgressBar">
<Setter Property="Foreground" Value="{StaticResource AKI_Brush_Yellow}"/>
</Style>
<Style Selector="ProgressBar">
<Setter Property="Foreground" Value="{StaticResource AKI_Brush_Yellow}"/>
</Style>
<Style Selector="ProgressBar.done">
<Setter Property="Foreground" Value="Green"/>
@ -65,7 +70,7 @@
</Style.Animations>
</Style>
<Style Selector="Separator">
<Setter Property="Background" Value="{StaticResource AKI_Background_Dark}"/>
</Style>
<Style Selector="Separator">
<Setter Property="Background" Value="{StaticResource AKI_Background_Dark}"/>
</Style>
</Styles>

View File

@ -24,8 +24,7 @@ namespace PatchClient
return AppBuilder.Configure<App>()
.UseReactiveUI()
.UsePlatformDetect()
.LogToTrace()
.UseReactiveUI();
.LogToTrace();
}
}
}

View File

@ -1,5 +1,4 @@
using Avalonia;
using Avalonia.Threading;
using Avalonia.Threading;
using PatchClient.Models;
using PatcherUtils;
using ReactiveUI;
@ -45,44 +44,16 @@ namespace PatchClient.ViewModels
{
this.WhenActivated((CompositeDisposable disposables) =>
{
//Test();
if(!Directory.Exists(LazyOperations.PatchFolder))
{
NavigateTo(new MessageViewModel(HostScreen, $"{LazyOperations.PatchFolder} folder is missing. Please copy it to\n'{Environment.CurrentDirectory}'\nand try patching again."));
return;
}
RunPatcher();
});
}
/// <summary>
/// A dumb testing method to see if things look right. Obsolete is used more like a warning here.
/// </summary>
[Obsolete]
private void Test()
{
Task.Run(async () =>
{
LineItem x = new LineItem("test 1", 30);
LineItem xx = new LineItem("test 2", 100);
LineItem xxx = new LineItem("test 3", 70);
LineItems.Add(new LineItemProgress(x));
LineItems.Add(new LineItemProgress(xx));
LineItems.Add(new LineItemProgress(xxx));
for (int i = 0; i <= 100; i++)
{
System.Threading.Thread.Sleep(20);
PatchPercent = i;
ProgressMessage = $"Patching @ {i}%";
foreach (var item in LineItems)
{
item.UpdateProgress(item.Total - i);
}
}
await NavigateToWithDelay(new MessageViewModel(HostScreen, "Test Complete"), 400);
});
}
private void RunPatcher()
{
Task.Run(async() =>

View File

@ -11,10 +11,11 @@
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<Label Content="You can close this window"
FontSize="12" FontWeight="SemiBold"/>
<Label Content="{Binding InfoText}"
Classes="yellow"
FontSize="12" FontWeight="SemiBold"
/>
<TextBlock Text="{Binding InfoText}" TextWrapping="Wrap"
Classes="yellow"
/>
</StackPanel>
</UserControl>

View File

@ -24,8 +24,7 @@ namespace PatchGenerator
return AppBuilder.Configure<App>()
.UseReactiveUI()
.UsePlatformDetect()
.LogToTrace()
.UseReactiveUI();
.LogToTrace();
}
}
}