From 2aa1af2c7c8f5c7aa7a1595dcd6f66f04c1abf57 Mon Sep 17 00:00:00 2001 From: Patchzy <64382339+patchzyy@users.noreply.github.com> Date: Wed, 25 Mar 2026 23:41:53 +0100 Subject: [PATCH] Add Skip option; clear surface on render failure --- .../Patterns/MiiImages/Mii3DRender.axaml.cs | 1 + .../Generic/MiiRenderingSetupPopup.axaml | 13 ++++++++---- .../Generic/MiiRenderingSetupPopup.axaml.cs | 20 +++++++++++++++---- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/WheelWizard/Views/Patterns/MiiImages/Mii3DRender.axaml.cs b/WheelWizard/Views/Patterns/MiiImages/Mii3DRender.axaml.cs index 8c09aac9..533c4cf0 100644 --- a/WheelWizard/Views/Patterns/MiiImages/Mii3DRender.axaml.cs +++ b/WheelWizard/Views/Patterns/MiiImages/Mii3DRender.axaml.cs @@ -272,6 +272,7 @@ private async Task RenderWorkerLoopAsync() if (result.IsFailure) { + await Dispatcher.UIThread.InvokeAsync(() => ClearSurface(render.Generation), DispatcherPriority.Background); continue; } diff --git a/WheelWizard/Views/Popups/Generic/MiiRenderingSetupPopup.axaml b/WheelWizard/Views/Popups/Generic/MiiRenderingSetupPopup.axaml index 9ba4c592..3e6382d0 100644 --- a/WheelWizard/Views/Popups/Generic/MiiRenderingSetupPopup.axaml +++ b/WheelWizard/Views/Popups/Generic/MiiRenderingSetupPopup.axaml @@ -14,7 +14,7 @@ Margin="0,14,0,0" TextWrapping="Wrap" Classes="BodyText" - Text="Wheel Wizard needs one external file to render Miis offline. Download it once and it will be stored in your Wheel Wizard data folder." /> + Text="Wheel Wizard can use one external file to render Miis offline in 3D. Download it once and it will be stored in your Wheel Wizard data folder, or skip and continue without 3D Mii rendering." /> + Text="Skip opens Wheel Wizard without offline 3D Mii rendering. Close exits the app." /> + diff --git a/WheelWizard/Views/Popups/Generic/MiiRenderingSetupPopup.axaml.cs b/WheelWizard/Views/Popups/Generic/MiiRenderingSetupPopup.axaml.cs index 1b476ffe..627e0d87 100644 --- a/WheelWizard/Views/Popups/Generic/MiiRenderingSetupPopup.axaml.cs +++ b/WheelWizard/Views/Popups/Generic/MiiRenderingSetupPopup.axaml.cs @@ -12,6 +12,7 @@ public partial class MiiRenderingSetupPopup : PopupContent private readonly TaskCompletionSource _completionSource = new(); private CancellationTokenSource? _downloadCancellationTokenSource; private bool _downloadCompleted; + private bool _skipRequested; [Inject] private IMiiRenderingResourceInstaller ResourceInstaller { get; set; } = null!; @@ -24,7 +25,7 @@ public MiiRenderingSetupPopup() { InitializeComponent(); PathTextBlock.Text = PathManager.MiiRenderingResourceFilePath; - StatusTextBlock.Text = "Download the Mii rendering resource to continue."; + StatusTextBlock.Text = "Download the Mii rendering resource to enable offline 3D Mii rendering."; ProgressTextBlock.Text = "Ready to install."; } @@ -66,7 +67,7 @@ private async void DownloadButton_OnClick(object? sender, RoutedEventArgs e) _downloadCancellationTokenSource = null; if (!_downloadCompleted) - SetBusyState(false, "Download the Mii rendering resource to continue."); + SetBusyState(false, "Download the Mii rendering resource to enable offline 3D Mii rendering."); } } @@ -93,16 +94,27 @@ private void CloseButton_OnClick(object? sender, RoutedEventArgs e) Close(); } + private void SkipButton_OnClick(object? sender, RoutedEventArgs e) + { + if (_downloadCancellationTokenSource != null) + return; + + _skipRequested = true; + _completionSource.TrySetResult(true); + Close(); + } + protected override void BeforeClose() { _downloadCancellationTokenSource?.Cancel(); - _completionSource.TrySetResult(_downloadCompleted); + _completionSource.TrySetResult(_downloadCompleted || _skipRequested); } private void SetBusyState(bool busy, string statusText) { StatusTextBlock.Text = statusText; DownloadButton.IsEnabled = !busy; + SkipButton.IsEnabled = !busy; CloseButton.IsEnabled = true; CloseButton.Text = busy ? "Close and Exit" : "Close"; } @@ -111,7 +123,7 @@ private void ShowError(string message) { ErrorTextBlock.Text = message; ErrorTextBlock.IsVisible = true; - SetBusyState(false, "Download the Mii rendering resource to continue."); + SetBusyState(false, "Download the Mii rendering resource to enable offline 3D Mii rendering."); } private static string FormatMegabytes(long bytes) => $"{bytes / 1024d / 1024d:F2} MB";