From 9a2cfcdf0fe37fb31af48c7ab1494b241afc8b1c Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Sat, 30 Apr 2022 12:02:16 -0400 Subject: [PATCH 1/3] remove duplicate reactiveUI calls --- Patcher/PatchClient/Program.cs | 3 +-- Patcher/PatchGenerator/Program.cs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) 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/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(); } } } From 36b39c7998bf8b8821ae85258a64f60d05acf2f6 Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Sat, 30 Apr 2022 12:03:09 -0400 Subject: [PATCH 2/3] update message view with textblock to wrap text --- Patcher/PatchClient/Assets/Styles.axaml | 55 +++++++++++---------- Patcher/PatchClient/Views/MessageView.axaml | 7 +-- 2 files changed, 34 insertions(+), 28 deletions(-) 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/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 @@ From 2d7d93a6420ae7d504750ede32862dde2a956e88 Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Sat, 30 Apr 2022 12:05:13 -0400 Subject: [PATCH 3/3] add patch folder check to client, updated client resource --- .../ViewModels/PatcherViewModel.cs | 43 +++---------------- .../PatchGenerator/Resources/PatchClient.exe | 4 +- 2 files changed, 9 insertions(+), 38 deletions(-) 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/PatchGenerator/Resources/PatchClient.exe b/Patcher/PatchGenerator/Resources/PatchClient.exe index febfa9a..f74bfa8 100644 --- a/Patcher/PatchGenerator/Resources/PatchClient.exe +++ b/Patcher/PatchGenerator/Resources/PatchClient.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3f9d18f470b8256cc0e1a5f524103a4137f229f2d346ea48fbfffb8ef156f1f2 -size 25319596 +oid sha256:0d8fd2f0c7b74f0db0fb10ce5b8a12778d519d769bf752496949d3ae51addae6 +size 25318060