From cd7fbf60f8e84776cff08b200fc28d401e20e172 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 22 Dec 2024 16:55:29 -0800 Subject: [PATCH 1/4] UI: Option to automatically Hide UI when game launches Quality of life feature. Removes the need to manually hide UI every time the game launches --- src/Ryujinx/AppHost.cs | 2 +- src/Ryujinx/Assets/locales.json | 24 +++++++++++++++++++ .../UI/ViewModels/MainWindowViewModel.cs | 18 ++++++++++++++ .../UI/Views/Main/MainMenuBarView.axaml | 23 ++++++++++++++++++ .../Configuration/ConfigurationFileFormat.cs | 5 ++++ .../Configuration/ConfigurationState.Model.cs | 6 +++++ .../Configuration/ConfigurationState.cs | 2 ++ 7 files changed, 79 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs index c728ee9c9..402874cdd 100644 --- a/src/Ryujinx/AppHost.cs +++ b/src/Ryujinx/AppHost.cs @@ -1042,7 +1042,7 @@ private void RenderLoop() _viewModel.WindowState = WindowState.FullScreen; } - if (_viewModel.WindowState is WindowState.FullScreen) + if (_viewModel.WindowState is WindowState.FullScreen || _viewModel.StartGamesWithoutUI) { _viewModel.ShowMenuAndStatusBar = false; } diff --git a/src/Ryujinx/Assets/locales.json b/src/Ryujinx/Assets/locales.json index 6f22e7d06..2ff65ee64 100644 --- a/src/Ryujinx/Assets/locales.json +++ b/src/Ryujinx/Assets/locales.json @@ -572,6 +572,30 @@ "zh_TW": "使用全螢幕模式啟動遊戲" } }, + { + "ID": "MenuBarOptionsStartGamesWithoutUI", + "Translations": { + "ar_SA": "", + "de_DE": "", + "el_GR": "", + "en_US": "Start Games with UI Hidden", + "es_ES": "", + "fr_FR": "", + "he_IL": "", + "it_IT": "", + "ja_JP": "", + "ko_KR": "", + "no_NO": "", + "pl_PL": "", + "pt_BR": "", + "ru_RU": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, { "ID": "MenuBarOptionsStopEmulation", "Translations": { diff --git a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs index b7a43ccaf..45f51e0c1 100644 --- a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs @@ -488,6 +488,19 @@ public bool StartGamesInFullscreen } } + public bool StartGamesWithoutUI + { + get => ConfigurationState.Instance.UI.StartNoUI; + set + { + ConfigurationState.Instance.UI.StartNoUI.Value = value; + + ConfigurationState.Instance.ToFileFormat().SaveConfig(Program.ConfigurationPath); + + OnPropertyChanged(); + } + } + public bool ShowConsole { get => ConfigurationState.Instance.UI.ShowConsole; @@ -1192,6 +1205,11 @@ public void ToggleStartGamesInFullscreen() StartGamesInFullscreen = !StartGamesInFullscreen; } + public void ToggleStartGamesWithoutUI() + { + StartGamesWithoutUI = !StartGamesWithoutUI; + } + public void ToggleShowConsole() { ShowConsole = !ShowConsole; diff --git a/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml index 78848e89b..09b83e033 100644 --- a/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml +++ b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml @@ -119,6 +119,29 @@ + + + + + + + + + public bool StartFullscreen { get; set; } + /// + /// Start games with UI hidden + /// + public bool StartNoUI { get; set; } + /// /// Show console window /// diff --git a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Model.cs b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Model.cs index fe5f2c3ad..8b4c79d0b 100644 --- a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Model.cs +++ b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Model.cs @@ -152,6 +152,11 @@ public WindowStartupSettings() /// public ReactiveObject StartFullscreen { get; private set; } + /// + /// Start games with UI hidden + /// + public ReactiveObject StartNoUI { get; private set; } + /// /// Hide / Show Console Window /// @@ -192,6 +197,7 @@ public UISection() WindowStartup = new WindowStartupSettings(); BaseStyle = new ReactiveObject(); StartFullscreen = new ReactiveObject(); + StartNoUI = new ReactiveObject(); GameListViewMode = new ReactiveObject(); ShowNames = new ReactiveObject(); GridSize = new ReactiveObject(); diff --git a/src/Ryujinx/Utilities/Configuration/ConfigurationState.cs b/src/Ryujinx/Utilities/Configuration/ConfigurationState.cs index 95ec62e83..21210bb0e 100644 --- a/src/Ryujinx/Utilities/Configuration/ConfigurationState.cs +++ b/src/Ryujinx/Utilities/Configuration/ConfigurationState.cs @@ -125,6 +125,7 @@ public ConfigurationFileFormat ToFileFormat() ApplicationSort = UI.ApplicationSort, IsAscendingOrder = UI.IsAscendingOrder, StartFullscreen = UI.StartFullscreen, + StartNoUI = UI.StartNoUI, ShowConsole = UI.ShowConsole, EnableKeyboard = Hid.EnableKeyboard, EnableMouse = Hid.EnableMouse, @@ -233,6 +234,7 @@ public void LoadDefault() UI.ApplicationSort.Value = 0; UI.IsAscendingOrder.Value = true; UI.StartFullscreen.Value = false; + UI.StartNoUI.Value = false; UI.ShowConsole.Value = true; UI.WindowStartup.WindowSizeWidth.Value = 1280; UI.WindowStartup.WindowSizeHeight.Value = 760; From 62f3f5414f25d6046febf4a5b81d3f18c36b21b8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 28 Dec 2024 15:16:11 -0800 Subject: [PATCH 2/4] Update locales.json Fix missing placeholder string for recently added Swedish locale --- src/Ryujinx/Assets/locales.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Ryujinx/Assets/locales.json b/src/Ryujinx/Assets/locales.json index 2ff65ee64..b752f4d44 100644 --- a/src/Ryujinx/Assets/locales.json +++ b/src/Ryujinx/Assets/locales.json @@ -589,6 +589,7 @@ "pl_PL": "", "pt_BR": "", "ru_RU": "", + "sv_SE": "", "th_TH": "", "tr_TR": "", "uk_UA": "", From e849f94a2e0042d8d1945d62f664caf059cb149a Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 1 Jan 2025 12:34:03 -0800 Subject: [PATCH 3/4] misc: Update ConfigurationState & Version Rebased to resolve PR conflicts --- src/Ryujinx/Assets/locales.json | 2 +- src/Ryujinx/Utilities/Configuration/ConfigurationFileFormat.cs | 2 +- .../Utilities/Configuration/ConfigurationState.Migration.cs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx/Assets/locales.json b/src/Ryujinx/Assets/locales.json index b752f4d44..3e3693cce 100644 --- a/src/Ryujinx/Assets/locales.json +++ b/src/Ryujinx/Assets/locales.json @@ -22623,4 +22623,4 @@ } } ] -} +} \ No newline at end of file diff --git a/src/Ryujinx/Utilities/Configuration/ConfigurationFileFormat.cs b/src/Ryujinx/Utilities/Configuration/ConfigurationFileFormat.cs index 766b05f78..6d3570850 100644 --- a/src/Ryujinx/Utilities/Configuration/ConfigurationFileFormat.cs +++ b/src/Ryujinx/Utilities/Configuration/ConfigurationFileFormat.cs @@ -17,7 +17,7 @@ public class ConfigurationFileFormat /// /// The current version of the file format /// - public const int CurrentVersion = 59; + public const int CurrentVersion = 60; /// /// Version of the configuration file format diff --git a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs index ec66bcaac..6210d20f2 100644 --- a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs +++ b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs @@ -414,7 +414,8 @@ in _migrations.OrderBy(x => x.Key)) // This was accidentally enabled by default when it was PRed. That is not what we want, // so as a compromise users who want to use it will simply need to re-enable it once after updating. cff.IgnoreApplet = false; - }) + }), + (60, static cff => cff.StartNoUI = false) ); } } From 6b44f324480f79948afe1ea3a55baf22d179984f Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 1 Jan 2025 12:41:19 -0800 Subject: [PATCH 4/4] Update ConfigurationState.Migration.cs --- .../Utilities/Configuration/ConfigurationState.Migration.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs index 6210d20f2..943aab513 100644 --- a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs +++ b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs @@ -127,6 +127,7 @@ in _migrations.OrderBy(x => x.Key)) UI.GridSize.Value = cff.GridSize; UI.ApplicationSort.Value = cff.ApplicationSort; UI.StartFullscreen.Value = cff.StartFullscreen; + UI.StartNoUI.Value = cff.StartNoUI; UI.ShowConsole.Value = cff.ShowConsole; UI.WindowStartup.WindowSizeWidth.Value = cff.WindowStartup.WindowSizeWidth; UI.WindowStartup.WindowSizeHeight.Value = cff.WindowStartup.WindowSizeHeight;