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/ConfigurationState.cs            | 24 +++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

(limited to 'Ryujinx.Ui.Common/Configuration/ConfigurationState.cs')

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<bool>();
                 EnableDockedMode.Event        += static (sender, e) => LogValueChange(sender, e, nameof(EnableDockedMode));
                 EnablePtc                     = new ReactiveObject<bool>();
-                EnablePtc.Event               += static (sender, e) => LogValueChange(sender, e, nameof(EnablePtc)); 
+                EnablePtc.Event               += static (sender, e) => LogValueChange(sender, e, nameof(EnablePtc));
                 EnableInternetAccess          = new ReactiveObject<bool>();
                 EnableInternetAccess.Event    += static (sender, e) => LogValueChange(sender, e, nameof(EnableInternetAccess));
                 EnableFsIntegrityChecks       = new ReactiveObject<bool>();
@@ -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<InputConfig>
             {
@@ -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-70-g09d2