From 2640f083b6d7bd40c80f81e5fc4660b6748103d2 Mon Sep 17 00:00:00 2001 From: Vova Date: Thu, 6 Feb 2025 20:12:56 +1000 Subject: [PATCH 01/20] Added custom setting function for each game --- .github/workflows/release.yml | 6 +- .../Services/SurfaceFlinger/SurfaceFlinger.cs | 1 + src/Ryujinx/AppHost.cs | 4 + src/Ryujinx/Assets/Styles/Styles.xaml | 23 +- src/Ryujinx/Assets/Styles/Themes.xaml | 8 +- src/Ryujinx/Assets/locales.json | 25 +++ src/Ryujinx/Program.cs | 62 +++++- src/Ryujinx/Ryujinx.csproj | 7 +- .../UI/Controls/ApplicationContextMenu.axaml | 5 + .../Controls/ApplicationContextMenu.axaml.cs | 34 ++- .../UI/Controls/ApplicationGridView.axaml | 38 +++- .../UI/Controls/ApplicationListView.axaml | 7 + .../UI/Controls/ApplicationListView.axaml.cs | 14 ++ .../UI/ViewModels/MainWindowViewModel.cs | 11 +- .../UI/ViewModels/SettingsViewModel.cs | 199 +++++++++++++++--- .../UI/Windows/UserConfigWindows.axaml | 139 ++++++++++++ .../UI/Windows/UserConfigWindows.axaml.cs | 108 ++++++++++ .../Utilities/AppLibrary/ApplicationData.cs | 1 + .../AppLibrary/ApplicationLibrary.cs | 5 +- src/Ryujinx/Utilities/CommandLineState.cs | 57 ++++- .../ConfigurationState.Migration.cs | 99 +++++---- src/Ryujinx/Utilities/ShortcutHelper.cs | 27 ++- 22 files changed, 776 insertions(+), 104 deletions(-) create mode 100644 src/Ryujinx/UI/Windows/UserConfigWindows.axaml create mode 100644 src/Ryujinx/UI/Windows/UserConfigWindows.axaml.cs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 072c6bf2f..bd302e661 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,9 +10,9 @@ env: POWERSHELL_TELEMETRY_OPTOUT: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1 RYUJINX_BASE_VERSION: "1.2" - RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "release" - RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "Ryubing" - RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "Ryujinx" + RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "master" + RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "Goodfeat" + RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "Ryujinx_alt" RELEASE: 1 jobs: diff --git a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs index 935e9895e..23bf8bcfc 100644 --- a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs +++ b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs @@ -10,6 +10,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading; +using VSyncMode = Ryujinx.Common.Configuration.VSyncMode; namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger { diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs index 25f451858..d49456b9a 100644 --- a/src/Ryujinx/AppHost.cs +++ b/src/Ryujinx/AppHost.cs @@ -582,6 +582,10 @@ namespace Ryujinx.Ava Rainbow.Disable(); Rainbow.Reset(); + //Reload settings when the game is turned off + //(resets custom settings if there were any) + Program.ReloadConfig(); + _isStopped = true; Stop(); } diff --git a/src/Ryujinx/Assets/Styles/Styles.xaml b/src/Ryujinx/Assets/Styles/Styles.xaml index 5523f551a..c3bc27efd 100644 --- a/src/Ryujinx/Assets/Styles/Styles.xaml +++ b/src/Ryujinx/Assets/Styles/Styles.xaml @@ -1,7 +1,8 @@ - - diff --git a/src/Ryujinx/UI/Windows/UserConfigWindows.axaml b/src/Ryujinx/UI/Windows/GameSpecificSettingsWindow.axaml similarity index 99% rename from src/Ryujinx/UI/Windows/UserConfigWindows.axaml rename to src/Ryujinx/UI/Windows/GameSpecificSettingsWindow.axaml index 3a9f3cff8..c7a5d1fa4 100644 --- a/src/Ryujinx/UI/Windows/UserConfigWindows.axaml +++ b/src/Ryujinx/UI/Windows/GameSpecificSettingsWindow.axaml @@ -1,5 +1,5 @@ ConfigurationFileFormat.CurrentVersion) @@ -50,14 +50,14 @@ namespace Ryujinx.Ava.Utilities.Configuration } - EnableDiscordIntegration.Value = LoadSetting ? cff.EnableDiscordIntegration : EnableDiscordIntegration.Value; // Get from global config only - CheckUpdatesOnStart.Value = LoadSetting ? cff.CheckUpdatesOnStart : CheckUpdatesOnStart.Value; // Get from global config only - UpdateCheckerType.Value = LoadSetting ? cff.UpdateCheckerType : UpdateCheckerType.Value; // Get from global config only - ShowConfirmExit.Value = LoadSetting ? cff.ShowConfirmExit : ShowConfirmExit.Value; // Get from global config only - RememberWindowState.Value = LoadSetting ? cff.RememberWindowState : RememberWindowState.Value; // Get from global config only - ShowTitleBar.Value = LoadSetting ? cff.ShowTitleBar : ShowTitleBar.Value; // Get from global config only - EnableHardwareAcceleration.Value = LoadSetting ? cff.EnableHardwareAcceleration : EnableHardwareAcceleration.Value; // Get from global config only - HideCursor.Value = LoadSetting ? cff.HideCursor : HideCursor.Value; // Get from global config only + EnableDiscordIntegration.Value = shouldLoadFromFile ? cff.EnableDiscordIntegration : EnableDiscordIntegration.Value; // Get from global config only + CheckUpdatesOnStart.Value = shouldLoadFromFile ? cff.CheckUpdatesOnStart : CheckUpdatesOnStart.Value; // Get from global config only + UpdateCheckerType.Value = shouldLoadFromFile ? cff.UpdateCheckerType : UpdateCheckerType.Value; // Get from global config only + ShowConfirmExit.Value = shouldLoadFromFile ? cff.ShowConfirmExit : ShowConfirmExit.Value; // Get from global config only + RememberWindowState.Value = shouldLoadFromFile ? cff.RememberWindowState : RememberWindowState.Value; // Get from global config only + ShowTitleBar.Value = shouldLoadFromFile ? cff.ShowTitleBar : ShowTitleBar.Value; // Get from global config only + EnableHardwareAcceleration.Value = shouldLoadFromFile ? cff.EnableHardwareAcceleration : EnableHardwareAcceleration.Value; // Get from global config only + HideCursor.Value = shouldLoadFromFile ? cff.HideCursor : HideCursor.Value; // Get from global config only Logger.EnableFileLog.Value = cff.EnableFileLog; Logger.EnableDebug.Value = cff.LoggingEnableDebug; @@ -93,7 +93,7 @@ namespace Ryujinx.Ava.Utilities.Configuration System.Language.Value = cff.SystemLanguage; System.Region.Value = cff.SystemRegion; System.TimeZone.Value = cff.SystemTimeZone; - System.SystemTimeOffset.Value = LoadSetting ? cff.SystemTimeOffset : System.SystemTimeOffset.Value; // Get from global config only + System.SystemTimeOffset.Value = shouldLoadFromFile ? cff.SystemTimeOffset : System.SystemTimeOffset.Value; // Get from global config only System.EnableDockedMode.Value = cff.DockedMode; System.EnablePtc.Value = cff.EnablePtc; System.EnableLowPowerPtc.Value = cff.EnableLowPowerPtc; @@ -108,46 +108,46 @@ namespace Ryujinx.Ava.Utilities.Configuration System.IgnoreApplet.Value = cff.IgnoreApplet; System.UseHypervisor.Value = cff.UseHypervisor; - UI.GuiColumns.FavColumn.Value = LoadSetting ? cff.GuiColumns.FavColumn : UI.GuiColumns.FavColumn.Value; - UI.GuiColumns.IconColumn.Value = LoadSetting ? cff.GuiColumns.IconColumn : UI.GuiColumns.IconColumn.Value; - UI.GuiColumns.AppColumn.Value = LoadSetting ? cff.GuiColumns.AppColumn : UI.GuiColumns.AppColumn.Value; - UI.GuiColumns.DevColumn.Value = LoadSetting ? cff.GuiColumns.DevColumn : UI.GuiColumns.DevColumn.Value; - UI.GuiColumns.VersionColumn.Value = LoadSetting ? cff.GuiColumns.VersionColumn : UI.GuiColumns.VersionColumn.Value; - UI.GuiColumns.TimePlayedColumn.Value = LoadSetting ? cff.GuiColumns.TimePlayedColumn : UI.GuiColumns.TimePlayedColumn.Value; - UI.GuiColumns.LastPlayedColumn.Value = LoadSetting ? cff.GuiColumns.LastPlayedColumn : UI.GuiColumns.LastPlayedColumn.Value; - UI.GuiColumns.FileExtColumn.Value = LoadSetting ? cff.GuiColumns.FileExtColumn : UI.GuiColumns.FileExtColumn.Value; - UI.GuiColumns.FileSizeColumn.Value = LoadSetting ? cff.GuiColumns.FileSizeColumn : UI.GuiColumns.FileSizeColumn.Value; - UI.GuiColumns.PathColumn.Value = LoadSetting ? cff.GuiColumns.PathColumn : UI.GuiColumns.PathColumn.Value; - UI.ColumnSort.SortColumnId.Value = LoadSetting ? cff.ColumnSort.SortColumnId : UI.ColumnSort.SortColumnId.Value; - UI.ColumnSort.SortAscending.Value = LoadSetting ? cff.ColumnSort.SortAscending : UI.ColumnSort.SortAscending.Value; - UI.GameDirs.Value = LoadSetting ? cff.GameDirs : UI.GameDirs.Value; - UI.AutoloadDirs.Value = LoadSetting ? (cff.AutoloadDirs ?? []) : UI.AutoloadDirs.Value; - UI.ShownFileTypes.NSP.Value = LoadSetting ? cff.ShownFileTypes.NSP : UI.ShownFileTypes.NSP.Value; - UI.ShownFileTypes.PFS0.Value = LoadSetting ? cff.ShownFileTypes.PFS0 : UI.ShownFileTypes.PFS0.Value; - UI.ShownFileTypes.XCI.Value = LoadSetting ? cff.ShownFileTypes.XCI : UI.ShownFileTypes.XCI.Value; - UI.ShownFileTypes.NCA.Value = LoadSetting ? cff.ShownFileTypes.NCA : UI.ShownFileTypes.NCA.Value; - UI.ShownFileTypes.NRO.Value = LoadSetting ? cff.ShownFileTypes.NRO : UI.ShownFileTypes.NRO.Value; - UI.ShownFileTypes.NSO.Value = LoadSetting ? cff.ShownFileTypes.NSO : UI.ShownFileTypes.NSO.Value; - UI.LanguageCode.Value = LoadSetting ? cff.LanguageCode : UI.LanguageCode.Value; - UI.BaseStyle.Value = LoadSetting ? cff.BaseStyle : UI.BaseStyle.Value; - UI.GameListViewMode.Value = LoadSetting ? cff.GameListViewMode : UI.GameListViewMode.Value; - UI.ShowNames.Value = LoadSetting ? cff.ShowNames : UI.ShowNames.Value; - UI.IsAscendingOrder.Value = LoadSetting ? cff.IsAscendingOrder : UI.IsAscendingOrder.Value; - UI.GridSize.Value = LoadSetting ? cff.GridSize : UI.GridSize.Value; - UI.ApplicationSort.Value = LoadSetting ? cff.ApplicationSort : UI.ApplicationSort.Value; - UI.StartFullscreen.Value = LoadSetting ? cff.StartFullscreen : UI.StartFullscreen.Value; - UI.StartNoUI.Value = LoadSetting ? cff.StartNoUI : UI.StartNoUI.Value; - UI.ShowConsole.Value = LoadSetting ? cff.ShowConsole : UI.ShowConsole.Value; - UI.WindowStartup.WindowSizeWidth.Value = LoadSetting ? cff.WindowStartup.WindowSizeWidth : UI.WindowStartup.WindowSizeWidth.Value; - UI.WindowStartup.WindowSizeHeight.Value = LoadSetting ? cff.WindowStartup.WindowSizeHeight : UI.WindowStartup.WindowSizeHeight.Value; - UI.WindowStartup.WindowPositionX.Value = LoadSetting ? cff.WindowStartup.WindowPositionX : UI.WindowStartup.WindowPositionX.Value; - UI.WindowStartup.WindowPositionY.Value = LoadSetting ? cff.WindowStartup.WindowPositionY : UI.WindowStartup.WindowPositionY.Value; - UI.WindowStartup.WindowMaximized.Value = LoadSetting ? cff.WindowStartup.WindowMaximized : UI.WindowStartup.WindowMaximized.Value; + UI.GuiColumns.FavColumn.Value = shouldLoadFromFile ? cff.GuiColumns.FavColumn : UI.GuiColumns.FavColumn.Value; + UI.GuiColumns.IconColumn.Value = shouldLoadFromFile ? cff.GuiColumns.IconColumn : UI.GuiColumns.IconColumn.Value; + UI.GuiColumns.AppColumn.Value = shouldLoadFromFile ? cff.GuiColumns.AppColumn : UI.GuiColumns.AppColumn.Value; + UI.GuiColumns.DevColumn.Value = shouldLoadFromFile ? cff.GuiColumns.DevColumn : UI.GuiColumns.DevColumn.Value; + UI.GuiColumns.VersionColumn.Value = shouldLoadFromFile ? cff.GuiColumns.VersionColumn : UI.GuiColumns.VersionColumn.Value; + UI.GuiColumns.TimePlayedColumn.Value = shouldLoadFromFile ? cff.GuiColumns.TimePlayedColumn : UI.GuiColumns.TimePlayedColumn.Value; + UI.GuiColumns.LastPlayedColumn.Value = shouldLoadFromFile ? cff.GuiColumns.LastPlayedColumn : UI.GuiColumns.LastPlayedColumn.Value; + UI.GuiColumns.FileExtColumn.Value = shouldLoadFromFile ? cff.GuiColumns.FileExtColumn : UI.GuiColumns.FileExtColumn.Value; + UI.GuiColumns.FileSizeColumn.Value = shouldLoadFromFile ? cff.GuiColumns.FileSizeColumn : UI.GuiColumns.FileSizeColumn.Value; + UI.GuiColumns.PathColumn.Value = shouldLoadFromFile ? cff.GuiColumns.PathColumn : UI.GuiColumns.PathColumn.Value; + UI.ColumnSort.SortColumnId.Value = shouldLoadFromFile ? cff.ColumnSort.SortColumnId : UI.ColumnSort.SortColumnId.Value; + UI.ColumnSort.SortAscending.Value = shouldLoadFromFile ? cff.ColumnSort.SortAscending : UI.ColumnSort.SortAscending.Value; + UI.GameDirs.Value = shouldLoadFromFile ? cff.GameDirs : UI.GameDirs.Value; + UI.AutoloadDirs.Value = shouldLoadFromFile ? (cff.AutoloadDirs ?? []) : UI.AutoloadDirs.Value; + UI.ShownFileTypes.NSP.Value = shouldLoadFromFile ? cff.ShownFileTypes.NSP : UI.ShownFileTypes.NSP.Value; + UI.ShownFileTypes.PFS0.Value = shouldLoadFromFile ? cff.ShownFileTypes.PFS0 : UI.ShownFileTypes.PFS0.Value; + UI.ShownFileTypes.XCI.Value = shouldLoadFromFile ? cff.ShownFileTypes.XCI : UI.ShownFileTypes.XCI.Value; + UI.ShownFileTypes.NCA.Value = shouldLoadFromFile ? cff.ShownFileTypes.NCA : UI.ShownFileTypes.NCA.Value; + UI.ShownFileTypes.NRO.Value = shouldLoadFromFile ? cff.ShownFileTypes.NRO : UI.ShownFileTypes.NRO.Value; + UI.ShownFileTypes.NSO.Value = shouldLoadFromFile ? cff.ShownFileTypes.NSO : UI.ShownFileTypes.NSO.Value; + UI.LanguageCode.Value = shouldLoadFromFile ? cff.LanguageCode : UI.LanguageCode.Value; + UI.BaseStyle.Value = shouldLoadFromFile ? cff.BaseStyle : UI.BaseStyle.Value; + UI.GameListViewMode.Value = shouldLoadFromFile ? cff.GameListViewMode : UI.GameListViewMode.Value; + UI.ShowNames.Value = shouldLoadFromFile ? cff.ShowNames : UI.ShowNames.Value; + UI.IsAscendingOrder.Value = shouldLoadFromFile ? cff.IsAscendingOrder : UI.IsAscendingOrder.Value; + UI.GridSize.Value = shouldLoadFromFile ? cff.GridSize : UI.GridSize.Value; + UI.ApplicationSort.Value = shouldLoadFromFile ? cff.ApplicationSort : UI.ApplicationSort.Value; + UI.StartFullscreen.Value = shouldLoadFromFile ? cff.StartFullscreen : UI.StartFullscreen.Value; + UI.StartNoUI.Value = shouldLoadFromFile ? cff.StartNoUI : UI.StartNoUI.Value; + UI.ShowConsole.Value = shouldLoadFromFile ? cff.ShowConsole : UI.ShowConsole.Value; + UI.WindowStartup.WindowSizeWidth.Value = shouldLoadFromFile ? cff.WindowStartup.WindowSizeWidth : UI.WindowStartup.WindowSizeWidth.Value; + UI.WindowStartup.WindowSizeHeight.Value = shouldLoadFromFile ? cff.WindowStartup.WindowSizeHeight : UI.WindowStartup.WindowSizeHeight.Value; + UI.WindowStartup.WindowPositionX.Value = shouldLoadFromFile ? cff.WindowStartup.WindowPositionX : UI.WindowStartup.WindowPositionX.Value; + UI.WindowStartup.WindowPositionY.Value = shouldLoadFromFile ? cff.WindowStartup.WindowPositionY : UI.WindowStartup.WindowPositionY.Value; + UI.WindowStartup.WindowMaximized.Value = shouldLoadFromFile ? cff.WindowStartup.WindowMaximized : UI.WindowStartup.WindowMaximized.Value; Hid.EnableKeyboard.Value = cff.EnableKeyboard; Hid.EnableMouse.Value = cff.EnableMouse; - Hid.Hotkeys.Value = LoadSetting ? cff.Hotkeys : Hid.Hotkeys.Value; // Get from global config only + Hid.Hotkeys.Value = shouldLoadFromFile ? cff.Hotkeys : Hid.Hotkeys.Value; // Get from global config only Hid.InputConfig.Value = cff.InputConfig ?? []; Hid.RainbowSpeed.Value = cff.RainbowSpeed; From 2dd787fb7ba849013750fea0e03b6b282153bcb8 Mon Sep 17 00:00:00 2001 From: Vova Date: Wed, 12 Feb 2025 16:00:37 +1000 Subject: [PATCH 19/20] Changed: Hid.DisableInputWhenOutOfFocus only for global config --- .../Utilities/Configuration/ConfigurationState.Migration.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs index f1fcf7fcf..386abcbe5 100644 --- a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs +++ b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs @@ -147,7 +147,7 @@ namespace Ryujinx.Ava.Utilities.Configuration Hid.EnableKeyboard.Value = cff.EnableKeyboard; Hid.EnableMouse.Value = cff.EnableMouse; - Hid.DisableInputWhenOutOfFocus.Value = cff.DisableInputWhenOutOfFocus; + Hid.DisableInputWhenOutOfFocus.Value = shouldLoadFromFile ? cff.DisableInputWhenOutOfFocus: Hid.DisableInputWhenOutOfFocus.Value; // Get from global config only Hid.Hotkeys.Value = shouldLoadFromFile ? cff.Hotkeys : Hid.Hotkeys.Value; // Get from global config only Hid.InputConfig.Value = cff.InputConfig ?? []; Hid.RainbowSpeed.Value = cff.RainbowSpeed; From 1dedf4c8d53f6694e7780d39b86ad4b68fd65865 Mon Sep 17 00:00:00 2001 From: Vova Date: Thu, 13 Feb 2025 16:34:03 +1000 Subject: [PATCH 20/20] fixed: when loading a game with a custom configuration via a shortcut or rebooting, when entering the settings menu, a menu for global configuration was displayed. --- src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs | 7 ++++++- src/Ryujinx/UI/Windows/MainWindow.axaml.cs | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs index d881bff98..5eca7f498 100644 --- a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs @@ -355,6 +355,11 @@ namespace Ryujinx.Ava.UI.ViewModels _ => null, }; } + set + { + ListSelectedApplication = value; + GridSelectedApplication = value; + } } public bool HasCompatibilityEntry => SelectedApplication.HasPlayabilityInfo; @@ -1541,7 +1546,7 @@ namespace Ryujinx.Ava.UI.ViewModels { BackendThreadingInit = ConfigurationState.Instance.Graphics.BackendThreading.Value.ToString(); } - + // If a configuration is found in the "/games/xxxxxxxxxxxxxx" folder, the program will load the user setting. string idGame = application.IdBaseString; if (ConfigurationFileFormat.TryLoad(Program.GetDirGameUserConfig(idGame), out ConfigurationFileFormat configurationFileFormat)) diff --git a/src/Ryujinx/UI/Windows/MainWindow.axaml.cs b/src/Ryujinx/UI/Windows/MainWindow.axaml.cs index 8f50aa965..bf55fac57 100644 --- a/src/Ryujinx/UI/Windows/MainWindow.axaml.cs +++ b/src/Ryujinx/UI/Windows/MainWindow.axaml.cs @@ -223,7 +223,7 @@ namespace Ryujinx.Ava.UI.Windows _deferLoad = true; _launchPath = launchPathArg; _launchApplicationId = launchApplicationId; - _startFullscreen = startFullscreenArg; + _startFullscreen = startFullscreenArg; } public void SwitchToGameControl(bool startFullscreen = false) @@ -374,6 +374,7 @@ namespace Ryujinx.Ava.UI.Windows if (applicationData != null) { + ViewModel.SelectedApplication = applicationData; await ViewModel.LoadApplication(applicationData, _startFullscreen); } else @@ -385,6 +386,7 @@ namespace Ryujinx.Ava.UI.Windows else { applicationData = applications[0]; + ViewModel.SelectedApplication = applicationData; await ViewModel.LoadApplication(applicationData, _startFullscreen); } }