diff --git a/Patcher/PatchClient/Assets/Styles.axaml b/Patcher/PatchClient/Assets/Styles.axaml index 0fbcd7f..8abf99c 100644 --- a/Patcher/PatchClient/Assets/Styles.axaml +++ b/Patcher/PatchClient/Assets/Styles.axaml @@ -4,42 +4,47 @@ - - - + + + - + + + + + - - - + + + - - - + diff --git a/Patcher/PatchClient/Program.cs b/Patcher/PatchClient/Program.cs index a69c6d5..71cb0a8 100644 --- a/Patcher/PatchClient/Program.cs +++ b/Patcher/PatchClient/Program.cs @@ -24,8 +24,7 @@ namespace PatchClient return AppBuilder.Configure() .UseReactiveUI() .UsePlatformDetect() - .LogToTrace() - .UseReactiveUI(); + .LogToTrace(); } } } diff --git a/Patcher/PatchClient/ViewModels/PatcherViewModel.cs b/Patcher/PatchClient/ViewModels/PatcherViewModel.cs index b54ac4a..8e5faef 100644 --- a/Patcher/PatchClient/ViewModels/PatcherViewModel.cs +++ b/Patcher/PatchClient/ViewModels/PatcherViewModel.cs @@ -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(); }); } - /// - /// A dumb testing method to see if things look right. Obsolete is used more like a warning here. - /// - [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() => diff --git a/Patcher/PatchClient/Views/MessageView.axaml b/Patcher/PatchClient/Views/MessageView.axaml index 9d52fd9..fa14934 100644 --- a/Patcher/PatchClient/Views/MessageView.axaml +++ b/Patcher/PatchClient/Views/MessageView.axaml @@ -11,10 +11,11 @@ diff --git a/Patcher/PatchGenerator/Program.cs b/Patcher/PatchGenerator/Program.cs index 43549a2..75d265e 100644 --- a/Patcher/PatchGenerator/Program.cs +++ b/Patcher/PatchGenerator/Program.cs @@ -24,8 +24,7 @@ namespace PatchGenerator return AppBuilder.Configure() .UseReactiveUI() .UsePlatformDetect() - .LogToTrace() - .UseReactiveUI(); + .LogToTrace(); } } } diff --git a/Patcher/PatchGenerator/Resources/PatchClient.exe b/Patcher/PatchGenerator/Resources/PatchClient.exe index 207dbdf..4ba4183 100644 Binary files a/Patcher/PatchGenerator/Resources/PatchClient.exe and b/Patcher/PatchGenerator/Resources/PatchClient.exe differ