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..3e3693cce 100644 --- a/src/Ryujinx/Assets/locales.json +++ b/src/Ryujinx/Assets/locales.json @@ -572,6 +572,31 @@ "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": "", + "sv_SE": "", + "th_TH": "", + "tr_TR": "", + "uk_UA": "", + "zh_CN": "", + "zh_TW": "" + } + }, { "ID": "MenuBarOptionsStopEmulation", "Translations": { @@ -22598,4 +22623,4 @@ } } ] -} +} \ No newline at end of file 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 @@ + + + + + + + + + /// The current version of the file format /// - public const int CurrentVersion = 59; + public const int CurrentVersion = 60; /// /// Version of the configuration file format @@ -351,6 +351,11 @@ public class ConfigurationFileFormat /// 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.Migration.cs b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs index ec66bcaac..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; @@ -414,7 +415,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) ); } } 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;