From 62f8ceb60b969db65a24d312dde7c6513a07ec46 Mon Sep 17 00:00:00 2001
From: MutantAura <44103205+MutantAura@users.noreply.github.com>
Date: Sun, 24 Jul 2022 19:44:47 +0100
Subject: Resolution scaling hotkeys (#3185)
* hotkeys
* comments
* update implementation to include custom scales
* copypasta
* review changes
* hotkeys
* comments
* update implementation to include custom scales
* copypasta
* review changes
* Remove outdated configuration and force hotkeys unbound
* Add avalonia support
* Fix configuration file
* Update GTK implementation and fix config... again.
* Remove legacy implementation + nits
* Avalonia locales (DeepL)
* review
* Remove colon from chinese locale
* Update ConfigFile
* locale fix
---
.../Configuration/ConfigurationFileFormat.cs | 4 ++--
.../Configuration/ConfigurationState.cs | 24 +++++++++++++++++++---
2 files changed, 23 insertions(+), 5 deletions(-)
(limited to 'Ryujinx.Ui.Common/Configuration')
diff --git a/Ryujinx.Ui.Common/Configuration/ConfigurationFileFormat.cs b/Ryujinx.Ui.Common/Configuration/ConfigurationFileFormat.cs
index 28a2956a..126399e7 100644
--- a/Ryujinx.Ui.Common/Configuration/ConfigurationFileFormat.cs
+++ b/Ryujinx.Ui.Common/Configuration/ConfigurationFileFormat.cs
@@ -14,7 +14,7 @@ namespace Ryujinx.Ui.Common.Configuration
///
/// The current version of the file format
///
- public const int CurrentVersion = 38;
+ public const int CurrentVersion = 39;
///
/// Version of the configuration file format
@@ -80,7 +80,7 @@ namespace Ryujinx.Ui.Common.Configuration
/// Enables printing error log messages
///
public bool LoggingEnableError { get; set; }
-
+
///
/// Enables printing trace log messages
///
diff --git a/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs b/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs
index c739b294..7f76dc3f 100644
--- a/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs
+++ b/Ryujinx.Ui.Common/Configuration/ConfigurationState.cs
@@ -310,7 +310,7 @@ namespace Ryujinx.Ui.Common.Configuration
EnableDockedMode = new ReactiveObject();
EnableDockedMode.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnableDockedMode));
EnablePtc = new ReactiveObject();
- EnablePtc.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnablePtc));
+ EnablePtc.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnablePtc));
EnableInternetAccess = new ReactiveObject();
EnableInternetAccess.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnableInternetAccess));
EnableFsIntegrityChecks = new ReactiveObject();
@@ -648,7 +648,9 @@ namespace Ryujinx.Ui.Common.Configuration
ToggleMute = Key.F2,
Screenshot = Key.F8,
ShowUi = Key.F4,
- Pause = Key.F5
+ Pause = Key.F5,
+ ResScaleUp = Key.Unbound,
+ ResScaleDown = Key.Unbound
};
Hid.InputConfig.Value = new List
{
@@ -967,7 +969,7 @@ namespace Ryujinx.Ui.Common.Configuration
if (configurationFileFormat.Version < 29)
{
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 29.");
-
+
configurationFileFormat.Hotkeys = new KeyboardHotkeys
{
ToggleVsync = Key.Tab,
@@ -1096,6 +1098,22 @@ namespace Ryujinx.Ui.Common.Configuration
configurationFileUpdated = true;
}
+ if (configurationFileFormat.Version < 39)
+ {
+ Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 39.");
+
+ configurationFileFormat.Hotkeys = new KeyboardHotkeys
+ {
+ ToggleVsync = configurationFileFormat.Hotkeys.ToggleVsync,
+ Screenshot = configurationFileFormat.Hotkeys.Screenshot,
+ ShowUi = configurationFileFormat.Hotkeys.ShowUi,
+ Pause = configurationFileFormat.Hotkeys.Pause,
+ ToggleMute = configurationFileFormat.Hotkeys.ToggleMute,
+ ResScaleUp = Key.Unbound,
+ ResScaleDown = Key.Unbound
+ };
+ }
+
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
Graphics.ResScale.Value = configurationFileFormat.ResScale;
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
--
cgit v1.2.3