Remember Hotkeys member on configuration structure to remain compatible with existing config files

This commit is contained in:
gdk 2023-03-02 23:06:07 -03:00
parent 17b0a77916
commit c2708bb429
3 changed files with 31 additions and 31 deletions

View file

@ -36,9 +36,9 @@ namespace Ryujinx.Input.Assigner
string GetPressedButton(); string GetPressedButton();
/// <summary> /// <summary>
/// Get the pressed button that was read in <see cref="ReadInput"/> by the button assigner. /// Get the pressed buttons that was read in <see cref="ReadInput"/> by the button assigner.
/// </summary> /// </summary>
/// <returns>The pressed button that was read</returns> /// <returns>The pressed buttons that was read</returns>
IEnumerable<PressedButton> GetPressedButtons(); IEnumerable<PressedButton> GetPressedButtons();
} }
} }

View file

@ -314,7 +314,7 @@ namespace Ryujinx.Ui.Common.Configuration
/// <summary> /// <summary>
/// Hotkey Keyboard Bindings /// Hotkey Keyboard Bindings
/// </summary> /// </summary>
public KeyboardHotkeys Hotkeys { get; set; } public KeyboardHotkeys HotkeysConfig { get; set; }
/// <summary> /// <summary>
/// Legacy keyboard control bindings /// Legacy keyboard control bindings

View file

@ -630,7 +630,7 @@ namespace Ryujinx.Ui.Common.Configuration
ShowConsole = Ui.ShowConsole, ShowConsole = Ui.ShowConsole,
EnableKeyboard = Hid.EnableKeyboard, EnableKeyboard = Hid.EnableKeyboard,
EnableMouse = Hid.EnableMouse, EnableMouse = Hid.EnableMouse,
Hotkeys = Hid.Hotkeys, HotkeysConfig = Hid.Hotkeys,
KeyboardConfig = new List<object>(), KeyboardConfig = new List<object>(),
ControllerConfig = new List<object>(), ControllerConfig = new List<object>(),
InputConfig = Hid.InputConfig, InputConfig = Hid.InputConfig,
@ -852,7 +852,7 @@ namespace Ryujinx.Ui.Common.Configuration
SortAscending = false SortAscending = false
}; };
configurationFileFormat.Hotkeys = new KeyboardHotkeys configurationFileFormat.HotkeysConfig = new KeyboardHotkeys
{ {
ToggleVsync = new Hotkey(Key.F1) ToggleVsync = new Hotkey(Key.F1)
}; };
@ -1033,7 +1033,7 @@ namespace Ryujinx.Ui.Common.Configuration
{ {
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 28."); Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 28.");
configurationFileFormat.Hotkeys = new KeyboardHotkeys configurationFileFormat.HotkeysConfig = new KeyboardHotkeys
{ {
ToggleVsync = new Hotkey(Key.F1), ToggleVsync = new Hotkey(Key.F1),
Screenshot = new Hotkey(Key.F8) Screenshot = new Hotkey(Key.F8)
@ -1046,7 +1046,7 @@ namespace Ryujinx.Ui.Common.Configuration
{ {
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 29."); Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 29.");
configurationFileFormat.Hotkeys = new KeyboardHotkeys configurationFileFormat.HotkeysConfig = new KeyboardHotkeys
{ {
ToggleVsync = new Hotkey(Key.F1), ToggleVsync = new Hotkey(Key.F1),
Screenshot = new Hotkey(Key.F8), Screenshot = new Hotkey(Key.F8),
@ -1089,11 +1089,11 @@ namespace Ryujinx.Ui.Common.Configuration
{ {
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 32."); Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 32.");
configurationFileFormat.Hotkeys = new KeyboardHotkeys configurationFileFormat.HotkeysConfig = new KeyboardHotkeys
{ {
ToggleVsync = configurationFileFormat.Hotkeys.ToggleVsync, ToggleVsync = configurationFileFormat.HotkeysConfig.ToggleVsync,
Screenshot = configurationFileFormat.Hotkeys.Screenshot, Screenshot = configurationFileFormat.HotkeysConfig.Screenshot,
ShowUi = configurationFileFormat.Hotkeys.ShowUi, ShowUi = configurationFileFormat.HotkeysConfig.ShowUi,
Pause = new Hotkey(Key.F5) Pause = new Hotkey(Key.F5)
}; };
@ -1104,12 +1104,12 @@ namespace Ryujinx.Ui.Common.Configuration
{ {
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 33."); Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 33.");
configurationFileFormat.Hotkeys = new KeyboardHotkeys configurationFileFormat.HotkeysConfig = new KeyboardHotkeys
{ {
ToggleVsync = configurationFileFormat.Hotkeys.ToggleVsync, ToggleVsync = configurationFileFormat.HotkeysConfig.ToggleVsync,
Screenshot = configurationFileFormat.Hotkeys.Screenshot, Screenshot = configurationFileFormat.HotkeysConfig.Screenshot,
ShowUi = configurationFileFormat.Hotkeys.ShowUi, ShowUi = configurationFileFormat.HotkeysConfig.ShowUi,
Pause = configurationFileFormat.Hotkeys.Pause, Pause = configurationFileFormat.HotkeysConfig.Pause,
ToggleMute = new Hotkey(Key.F2) ToggleMute = new Hotkey(Key.F2)
}; };
@ -1178,13 +1178,13 @@ namespace Ryujinx.Ui.Common.Configuration
{ {
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 39."); Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 39.");
configurationFileFormat.Hotkeys = new KeyboardHotkeys configurationFileFormat.HotkeysConfig = new KeyboardHotkeys
{ {
ToggleVsync = configurationFileFormat.Hotkeys.ToggleVsync, ToggleVsync = configurationFileFormat.HotkeysConfig.ToggleVsync,
Screenshot = configurationFileFormat.Hotkeys.Screenshot, Screenshot = configurationFileFormat.HotkeysConfig.Screenshot,
ShowUi = configurationFileFormat.Hotkeys.ShowUi, ShowUi = configurationFileFormat.HotkeysConfig.ShowUi,
Pause = configurationFileFormat.Hotkeys.Pause, Pause = configurationFileFormat.HotkeysConfig.Pause,
ToggleMute = configurationFileFormat.Hotkeys.ToggleMute, ToggleMute = configurationFileFormat.HotkeysConfig.ToggleMute,
ResScaleUp = new Hotkey(Key.Unbound), ResScaleUp = new Hotkey(Key.Unbound),
ResScaleDown = new Hotkey(Key.Unbound) ResScaleDown = new Hotkey(Key.Unbound)
}; };
@ -1207,15 +1207,15 @@ namespace Ryujinx.Ui.Common.Configuration
{ {
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 41."); Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 41.");
configurationFileFormat.Hotkeys = new KeyboardHotkeys configurationFileFormat.HotkeysConfig = new KeyboardHotkeys
{ {
ToggleVsync = configurationFileFormat.Hotkeys.ToggleVsync, ToggleVsync = configurationFileFormat.HotkeysConfig.ToggleVsync,
Screenshot = configurationFileFormat.Hotkeys.Screenshot, Screenshot = configurationFileFormat.HotkeysConfig.Screenshot,
ShowUi = configurationFileFormat.Hotkeys.ShowUi, ShowUi = configurationFileFormat.HotkeysConfig.ShowUi,
Pause = configurationFileFormat.Hotkeys.Pause, Pause = configurationFileFormat.HotkeysConfig.Pause,
ToggleMute = configurationFileFormat.Hotkeys.ToggleMute, ToggleMute = configurationFileFormat.HotkeysConfig.ToggleMute,
ResScaleUp = configurationFileFormat.Hotkeys.ResScaleUp, ResScaleUp = configurationFileFormat.HotkeysConfig.ResScaleUp,
ResScaleDown = configurationFileFormat.Hotkeys.ResScaleDown, ResScaleDown = configurationFileFormat.HotkeysConfig.ResScaleDown,
VolumeUp = new Hotkey(Key.Unbound), VolumeUp = new Hotkey(Key.Unbound),
VolumeDown = new Hotkey(Key.Unbound) VolumeDown = new Hotkey(Key.Unbound)
}; };
@ -1317,7 +1317,7 @@ namespace Ryujinx.Ui.Common.Configuration
Ui.ShowConsole.Value = configurationFileFormat.ShowConsole; Ui.ShowConsole.Value = configurationFileFormat.ShowConsole;
Hid.EnableKeyboard.Value = configurationFileFormat.EnableKeyboard; Hid.EnableKeyboard.Value = configurationFileFormat.EnableKeyboard;
Hid.EnableMouse.Value = configurationFileFormat.EnableMouse; Hid.EnableMouse.Value = configurationFileFormat.EnableMouse;
Hid.Hotkeys.Value = configurationFileFormat.Hotkeys; Hid.Hotkeys.Value = configurationFileFormat.HotkeysConfig;
Hid.InputConfig.Value = configurationFileFormat.InputConfig; Hid.InputConfig.Value = configurationFileFormat.InputConfig;
if (Hid.InputConfig.Value == null) if (Hid.InputConfig.Value == null)