From de40a2111d4f692a2ab0ecdbcdb9ac86732be8ec Mon Sep 17 00:00:00 2001 From: Neo Bihler Date: Tue, 31 Mar 2026 23:11:02 +0200 Subject: [PATCH 1/3] added a launch option --launch rr to start retro rewind right away --- WheelWizard/Views/App.axaml.cs | 70 ++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/WheelWizard/Views/App.axaml.cs b/WheelWizard/Views/App.axaml.cs index 1776bdc2..3aad4b5d 100644 --- a/WheelWizard/Views/App.axaml.cs +++ b/WheelWizard/Views/App.axaml.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.Logging; using WheelWizard.AutoUpdating; using WheelWizard.MiiRendering.Services; +using WheelWizard.Services.Launcher; using WheelWizard.Services; using WheelWizard.Services.LiveData; using WheelWizard.Services.UrlProtocol; @@ -18,6 +19,12 @@ namespace WheelWizard.Views; public class App : Application { + private enum StartupLaunchTarget + { + None, + RetroRewind, + } + /// /// Gets the service provider configured for this application. /// @@ -51,13 +58,64 @@ private void InitializeBehaviorOverrides() ToolTipBubbleBehavior.Initialize(); } - private static void OpenGameBananaModWindow() + private static string? GetLaunchProtocolArgument() { var args = Environment.GetCommandLineArgs(); + for (var i = 1; i < args.Length; i++) + { + var argument = args[i]; + if (argument.StartsWith("wheelwizard://", StringComparison.OrdinalIgnoreCase)) + return argument; + } + + return null; + } + + private static StartupLaunchTarget GetStartupLaunchTarget() + { + var args = Environment.GetCommandLineArgs(); + + for (var i = 1; i < args.Length; i++) + { + var argument = args[i]; + if (argument.Equals("--launch", StringComparison.OrdinalIgnoreCase) || argument.Equals("-l", StringComparison.OrdinalIgnoreCase)) + { + if (i + 1 >= args.Length) + continue; + + var launchTarget = args[++i]; + if (launchTarget.Equals("rr", StringComparison.OrdinalIgnoreCase) || + launchTarget.Equals("retrorewind", StringComparison.OrdinalIgnoreCase) || + launchTarget.Equals("retro-rewind", StringComparison.OrdinalIgnoreCase)) + { + return StartupLaunchTarget.RetroRewind; + } + + continue; + } + + if (!argument.StartsWith("--launch=", StringComparison.OrdinalIgnoreCase)) + continue; + + var launchTargetFromEquals = argument["--launch=".Length..].Trim(); + if (launchTargetFromEquals.Equals("rr", StringComparison.OrdinalIgnoreCase) || + launchTargetFromEquals.Equals("retrorewind", StringComparison.OrdinalIgnoreCase) || + launchTargetFromEquals.Equals("retro-rewind", StringComparison.OrdinalIgnoreCase)) + { + return StartupLaunchTarget.RetroRewind; + } + } + + return StartupLaunchTarget.None; + } + + private static void OpenGameBananaModWindow() + { ModManager.Instance.ReloadAsync(); - if (args.Length <= 1) + var protocolArgument = GetLaunchProtocolArgument(); + if (string.IsNullOrWhiteSpace(protocolArgument)) return; - var protocolArgument = args[1]; + _ = UrlProtocolManager.ShowPopupForLaunchUrlAsync(protocolArgument); } @@ -73,6 +131,12 @@ private async void OnInitializedAsync() await updateService.CheckForUpdatesAsync(); await whWzDataService.LoadBadgesAsync(); InitializeManagers(); + + if (GetStartupLaunchTarget() == StartupLaunchTarget.RetroRewind) + { + var rrLauncher = Services.GetRequiredService(); + await rrLauncher.Launch(); + } } catch (Exception e) { From de7387266d398dbc8f8961f2f1fa03ca625a6d9c Mon Sep 17 00:00:00 2001 From: Neo Bihler Date: Tue, 31 Mar 2026 23:30:32 +0200 Subject: [PATCH 2/3] Added a toggle in settings>other to start retro rewind on startup --- .../Features/Settings/ISettingsServices.cs | 1 + .../Features/Settings/SettingsManager.cs | 2 ++ .../Resources/Languages/Settings.Designer.cs | 18 ++++++++++++++++++ WheelWizard/Resources/Languages/Settings.resx | 6 ++++++ WheelWizard/Views/App.axaml.cs | 5 ++++- .../Views/Pages/Settings/OtherSettings.axaml | 6 ++++++ .../Pages/Settings/OtherSettings.axaml.cs | 7 +++++++ 7 files changed, 44 insertions(+), 1 deletion(-) diff --git a/WheelWizard/Features/Settings/ISettingsServices.cs b/WheelWizard/Features/Settings/ISettingsServices.cs index 063518a3..8875fa8e 100644 --- a/WheelWizard/Features/Settings/ISettingsServices.cs +++ b/WheelWizard/Features/Settings/ISettingsServices.cs @@ -24,6 +24,7 @@ public interface ISettingsProperties Setting GAME_LOCATION { get; } Setting FORCE_WIIMOTE { get; } Setting LAUNCH_WITH_DOLPHIN { get; } + Setting LAUNCH_RR_ON_STARTUP { get; } Setting PREFERS_MODS_ROW_VIEW { get; } Setting FOCUSED_USER { get; } Setting ENABLE_ANIMATIONS { get; } diff --git a/WheelWizard/Features/Settings/SettingsManager.cs b/WheelWizard/Features/Settings/SettingsManager.cs index d9ae7adf..1980ad23 100644 --- a/WheelWizard/Features/Settings/SettingsManager.cs +++ b/WheelWizard/Features/Settings/SettingsManager.cs @@ -109,6 +109,7 @@ IFileSystem fileSystem GAME_LOCATION = RegisterWhWz("GameLocation", "", value => _fileSystem.File.Exists(value as string ?? string.Empty)); FORCE_WIIMOTE = RegisterWhWz("ForceWiimote", false); LAUNCH_WITH_DOLPHIN = RegisterWhWz("LaunchWithDolphin", false); + LAUNCH_RR_ON_STARTUP = RegisterWhWz("LaunchRrOnStartup", false); PREFERS_MODS_ROW_VIEW = RegisterWhWz("PrefersModsRowView", true); FOCUSED_USER = RegisterWhWz("FavoriteUser", 0, value => (int)(value ?? -1) >= 0 && (int)(value ?? -1) < 4); @@ -195,6 +196,7 @@ IFileSystem fileSystem public Setting GAME_LOCATION { get; } public Setting FORCE_WIIMOTE { get; } public Setting LAUNCH_WITH_DOLPHIN { get; } + public Setting LAUNCH_RR_ON_STARTUP { get; } public Setting PREFERS_MODS_ROW_VIEW { get; } public Setting FOCUSED_USER { get; } public Setting ENABLE_ANIMATIONS { get; } diff --git a/WheelWizard/Resources/Languages/Settings.Designer.cs b/WheelWizard/Resources/Languages/Settings.Designer.cs index 929e13f2..2a7ba89c 100644 --- a/WheelWizard/Resources/Languages/Settings.Designer.cs +++ b/WheelWizard/Resources/Languages/Settings.Designer.cs @@ -157,6 +157,15 @@ public static string HelperText_LaunchWithDolphin { return ResourceManager.GetString("HelperText_LaunchWithDolphin", resourceCulture); } } + + /// + /// Looks up a localized string similar to Automatically launches Retro Rewind when Wheel Wizard starts. + /// + public static string HelperText_LaunchRrOnStartup { + get { + return ResourceManager.GetString("HelperText_LaunchRrOnStartup", resourceCulture); + } + } /// /// Looks up a localized string similar to You must set these 3 paths before you can start playing Retro Rewind. @@ -256,6 +265,15 @@ public static string Option_LaunchWithDolphin { return ResourceManager.GetString("Option_LaunchWithDolphin", resourceCulture); } } + + /// + /// Looks up a localized string similar to Launch Retro Rewind On Startup. + /// + public static string Option_LaunchRrOnStartup { + get { + return ResourceManager.GetString("Option_LaunchRrOnStartup", resourceCulture); + } + } /// /// Looks up a localized string similar to Make Primary. diff --git a/WheelWizard/Resources/Languages/Settings.resx b/WheelWizard/Resources/Languages/Settings.resx index f7b8a039..56d27c27 100644 --- a/WheelWizard/Resources/Languages/Settings.resx +++ b/WheelWizard/Resources/Languages/Settings.resx @@ -32,6 +32,9 @@ Launch Game With Dolphin Window + + Launch Retro Rewind On Startup + Language @@ -44,6 +47,9 @@ Will launch dolphins main window along with the game + + Automatically launches Retro Rewind when Wheel Wizard starts + This setting disables Wiimote ingame, but enables it for the Wii channel diff --git a/WheelWizard/Views/App.axaml.cs b/WheelWizard/Views/App.axaml.cs index 3aad4b5d..9ca1f839 100644 --- a/WheelWizard/Views/App.axaml.cs +++ b/WheelWizard/Views/App.axaml.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.Logging; using WheelWizard.AutoUpdating; using WheelWizard.MiiRendering.Services; +using WheelWizard.Settings; using WheelWizard.Services.Launcher; using WheelWizard.Services; using WheelWizard.Services.LiveData; @@ -132,7 +133,9 @@ private async void OnInitializedAsync() await whWzDataService.LoadBadgesAsync(); InitializeManagers(); - if (GetStartupLaunchTarget() == StartupLaunchTarget.RetroRewind) + var settingsManager = Services.GetRequiredService(); + var shouldLaunchRrOnStartup = settingsManager.Get(settingsManager.LAUNCH_RR_ON_STARTUP); + if (GetStartupLaunchTarget() == StartupLaunchTarget.RetroRewind || shouldLaunchRrOnStartup) { var rrLauncher = Services.GetRequiredService(); await rrLauncher.Launch(); diff --git a/WheelWizard/Views/Pages/Settings/OtherSettings.axaml b/WheelWizard/Views/Pages/Settings/OtherSettings.axaml index dbff71f3..2460a0b0 100644 --- a/WheelWizard/Views/Pages/Settings/OtherSettings.axaml +++ b/WheelWizard/Views/Pages/Settings/OtherSettings.axaml @@ -34,6 +34,12 @@ + + + diff --git a/WheelWizard/Views/Pages/Settings/OtherSettings.axaml.cs b/WheelWizard/Views/Pages/Settings/OtherSettings.axaml.cs index 8eb6eea4..20d10d86 100644 --- a/WheelWizard/Views/Pages/Settings/OtherSettings.axaml.cs +++ b/WheelWizard/Views/Pages/Settings/OtherSettings.axaml.cs @@ -31,6 +31,7 @@ public OtherSettings() // Attach event handlers after loading settings to avoid unwanted triggers DisableForce.IsCheckedChanged += ClickForceWiimote; LaunchWithDolphin.IsCheckedChanged += ClickLaunchWithDolphinWindow; + LaunchRrOnStartup.IsCheckedChanged += ClickLaunchRrOnStartup; } private void LoadSettings() @@ -38,6 +39,7 @@ private void LoadSettings() // Only loads when the settings are not disabled (aka when the paths are set up correctly) DisableForce.IsChecked = SettingsService.Get(SettingsService.FORCE_WIIMOTE); LaunchWithDolphin.IsChecked = SettingsService.Get(SettingsService.LAUNCH_WITH_DOLPHIN); + LaunchRrOnStartup.IsChecked = SettingsService.Get(SettingsService.LAUNCH_RR_ON_STARTUP); OpenSaveFolderButton.IsEnabled = Directory.Exists(PathManager.SaveFolderPath); } @@ -56,6 +58,11 @@ private void ClickLaunchWithDolphinWindow(object? sender, RoutedEventArgs e) SettingsService.Set(SettingsService.LAUNCH_WITH_DOLPHIN, LaunchWithDolphin.IsChecked == true); } + private void ClickLaunchRrOnStartup(object? sender, RoutedEventArgs e) + { + SettingsService.Set(SettingsService.LAUNCH_RR_ON_STARTUP, LaunchRrOnStartup.IsChecked == true); + } + private async void Reinstall_RetroRewind(object sender, RoutedEventArgs e) { var progressWindow = new ProgressWindow(); From 693f785685f29a7736b38636b6157dc352437862 Mon Sep 17 00:00:00 2001 From: Neo Bihler Date: Thu, 2 Apr 2026 11:36:03 +0200 Subject: [PATCH 3/3] fix when auto launch retro rewind is on it wont get launched when launching wheel wizard through gamebanana --- WheelWizard/Views/App.axaml.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/WheelWizard/Views/App.axaml.cs b/WheelWizard/Views/App.axaml.cs index 9ca1f839..bd1c454a 100644 --- a/WheelWizard/Views/App.axaml.cs +++ b/WheelWizard/Views/App.axaml.cs @@ -110,21 +110,22 @@ private static StartupLaunchTarget GetStartupLaunchTarget() return StartupLaunchTarget.None; } - private static void OpenGameBananaModWindow() + private static bool OpenGameBananaModWindow() { ModManager.Instance.ReloadAsync(); var protocolArgument = GetLaunchProtocolArgument(); if (string.IsNullOrWhiteSpace(protocolArgument)) - return; + return false; _ = UrlProtocolManager.ShowPopupForLaunchUrlAsync(protocolArgument); + return true; } private async void OnInitializedAsync() { try { - OpenGameBananaModWindow(); + var launchedFromProtocol = OpenGameBananaModWindow(); var updateService = Services.GetRequiredService(); var whWzDataService = Services.GetRequiredService(); @@ -134,8 +135,9 @@ private async void OnInitializedAsync() InitializeManagers(); var settingsManager = Services.GetRequiredService(); - var shouldLaunchRrOnStartup = settingsManager.Get(settingsManager.LAUNCH_RR_ON_STARTUP); - if (GetStartupLaunchTarget() == StartupLaunchTarget.RetroRewind || shouldLaunchRrOnStartup) + var requestedByCli = GetStartupLaunchTarget() == StartupLaunchTarget.RetroRewind; + var shouldLaunchRrOnStartup = !launchedFromProtocol && settingsManager.Get(settingsManager.LAUNCH_RR_ON_STARTUP); + if (requestedByCli || shouldLaunchRrOnStartup) { var rrLauncher = Services.GetRequiredService(); await rrLauncher.Launch();