From bd8d28c59d53ecd63dc00288fd0bf220b09773ee Mon Sep 17 00:00:00 2001 From: Xpl0itR Date: Tue, 1 Dec 2020 22:02:27 +0000 Subject: Add option to start games in fullscreen mode (#1580) * Add option to start games in fullscreen mode * Add command line option * Use pascal case on menu item --- .../Configuration/ConfigurationFileFormat.cs | 7 ++++++- Ryujinx.Common/Configuration/ConfigurationState.cs | 20 +++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) (limited to 'Ryujinx.Common/Configuration') diff --git a/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs b/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs index bfb1cdc1..5618b228 100644 --- a/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs +++ b/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs @@ -14,7 +14,7 @@ namespace Ryujinx.Configuration /// /// The current version of the file format /// - public const int CurrentVersion = 16; + public const int CurrentVersion = 17; public int Version { get; set; } @@ -188,6 +188,11 @@ namespace Ryujinx.Configuration /// public string CustomThemePath { get; set; } + /// + /// Start games in fullscreen mode + /// + public bool StartFullscreen { get; set; } + /// /// Enable or disable keyboard support (Independent from controllers binding) /// diff --git a/Ryujinx.Common/Configuration/ConfigurationState.cs b/Ryujinx.Common/Configuration/ConfigurationState.cs index 2d725149..ef4a4337 100644 --- a/Ryujinx.Common/Configuration/ConfigurationState.cs +++ b/Ryujinx.Common/Configuration/ConfigurationState.cs @@ -1,4 +1,4 @@ -using Ryujinx.Common; +using Ryujinx.Common; using Ryujinx.Common.Configuration; using Ryujinx.Common.Configuration.Hid; using Ryujinx.Common.Logging; @@ -82,6 +82,11 @@ namespace Ryujinx.Configuration /// public ReactiveObject CustomThemePath { get; private set; } + /// + /// Start games in fullscreen mode + /// + public ReactiveObject StartFullscreen { get; private set; } + public UiSection() { GuiColumns = new Columns(); @@ -89,6 +94,7 @@ namespace Ryujinx.Configuration GameDirs = new ReactiveObject>(); EnableCustomTheme = new ReactiveObject(); CustomThemePath = new ReactiveObject(); + StartFullscreen = new ReactiveObject(); } } @@ -435,6 +441,7 @@ namespace Ryujinx.Configuration GameDirs = Ui.GameDirs, EnableCustomTheme = Ui.EnableCustomTheme, CustomThemePath = Ui.CustomThemePath, + StartFullscreen = Ui.StartFullscreen, EnableKeyboard = Hid.EnableKeyboard, Hotkeys = Hid.Hotkeys, KeyboardConfig = keyboardConfigList, @@ -490,6 +497,7 @@ namespace Ryujinx.Configuration Ui.GameDirs.Value = new List(); Ui.EnableCustomTheme.Value = false; Ui.CustomThemePath.Value = ""; + Ui.StartFullscreen.Value = false; Hid.EnableKeyboard.Value = false; Hid.Hotkeys.Value = new KeyboardHotkeys { @@ -744,6 +752,15 @@ namespace Ryujinx.Configuration configurationFileUpdated = true; } + if (configurationFileFormat.Version < 17) + { + Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 17."); + + configurationFileFormat.StartFullscreen = false; + + configurationFileUpdated = true; + } + List inputConfig = new List(); inputConfig.AddRange(configurationFileFormat.ControllerConfig); inputConfig.AddRange(configurationFileFormat.KeyboardConfig); @@ -792,6 +809,7 @@ namespace Ryujinx.Configuration Ui.GameDirs.Value = configurationFileFormat.GameDirs; Ui.EnableCustomTheme.Value = configurationFileFormat.EnableCustomTheme; Ui.CustomThemePath.Value = configurationFileFormat.CustomThemePath; + Ui.StartFullscreen.Value = configurationFileFormat.StartFullscreen; Hid.EnableKeyboard.Value = configurationFileFormat.EnableKeyboard; Hid.Hotkeys.Value = configurationFileFormat.Hotkeys; Hid.InputConfig.Value = inputConfig; -- cgit v1.2.3