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();
/// <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>
/// <returns>The pressed button that was read</returns>
/// <returns>The pressed buttons that was read</returns>
IEnumerable<PressedButton> GetPressedButtons();
}
}

View file

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

View file

@ -630,7 +630,7 @@ namespace Ryujinx.Ui.Common.Configuration
ShowConsole = Ui.ShowConsole,
EnableKeyboard = Hid.EnableKeyboard,
EnableMouse = Hid.EnableMouse,
Hotkeys = Hid.Hotkeys,
HotkeysConfig = Hid.Hotkeys,
KeyboardConfig = new List<object>(),
ControllerConfig = new List<object>(),
InputConfig = Hid.InputConfig,
@ -852,7 +852,7 @@ namespace Ryujinx.Ui.Common.Configuration
SortAscending = false
};
configurationFileFormat.Hotkeys = new KeyboardHotkeys
configurationFileFormat.HotkeysConfig = new KeyboardHotkeys
{
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.");
configurationFileFormat.Hotkeys = new KeyboardHotkeys
configurationFileFormat.HotkeysConfig = new KeyboardHotkeys
{
ToggleVsync = new Hotkey(Key.F1),
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.");
configurationFileFormat.Hotkeys = new KeyboardHotkeys
configurationFileFormat.HotkeysConfig = new KeyboardHotkeys
{
ToggleVsync = new Hotkey(Key.F1),
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.");
configurationFileFormat.Hotkeys = new KeyboardHotkeys
configurationFileFormat.HotkeysConfig = new KeyboardHotkeys
{
ToggleVsync = configurationFileFormat.Hotkeys.ToggleVsync,
Screenshot = configurationFileFormat.Hotkeys.Screenshot,
ShowUi = configurationFileFormat.Hotkeys.ShowUi,
ToggleVsync = configurationFileFormat.HotkeysConfig.ToggleVsync,
Screenshot = configurationFileFormat.HotkeysConfig.Screenshot,
ShowUi = configurationFileFormat.HotkeysConfig.ShowUi,
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.");
configurationFileFormat.Hotkeys = new KeyboardHotkeys
configurationFileFormat.HotkeysConfig = new KeyboardHotkeys
{
ToggleVsync = configurationFileFormat.Hotkeys.ToggleVsync,
Screenshot = configurationFileFormat.Hotkeys.Screenshot,
ShowUi = configurationFileFormat.Hotkeys.ShowUi,
Pause = configurationFileFormat.Hotkeys.Pause,
ToggleVsync = configurationFileFormat.HotkeysConfig.ToggleVsync,
Screenshot = configurationFileFormat.HotkeysConfig.Screenshot,
ShowUi = configurationFileFormat.HotkeysConfig.ShowUi,
Pause = configurationFileFormat.HotkeysConfig.Pause,
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.");
configurationFileFormat.Hotkeys = new KeyboardHotkeys
configurationFileFormat.HotkeysConfig = new KeyboardHotkeys
{
ToggleVsync = configurationFileFormat.Hotkeys.ToggleVsync,
Screenshot = configurationFileFormat.Hotkeys.Screenshot,
ShowUi = configurationFileFormat.Hotkeys.ShowUi,
Pause = configurationFileFormat.Hotkeys.Pause,
ToggleMute = configurationFileFormat.Hotkeys.ToggleMute,
ToggleVsync = configurationFileFormat.HotkeysConfig.ToggleVsync,
Screenshot = configurationFileFormat.HotkeysConfig.Screenshot,
ShowUi = configurationFileFormat.HotkeysConfig.ShowUi,
Pause = configurationFileFormat.HotkeysConfig.Pause,
ToggleMute = configurationFileFormat.HotkeysConfig.ToggleMute,
ResScaleUp = 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.");
configurationFileFormat.Hotkeys = new KeyboardHotkeys
configurationFileFormat.HotkeysConfig = new KeyboardHotkeys
{
ToggleVsync = configurationFileFormat.Hotkeys.ToggleVsync,
Screenshot = configurationFileFormat.Hotkeys.Screenshot,
ShowUi = configurationFileFormat.Hotkeys.ShowUi,
Pause = configurationFileFormat.Hotkeys.Pause,
ToggleMute = configurationFileFormat.Hotkeys.ToggleMute,
ResScaleUp = configurationFileFormat.Hotkeys.ResScaleUp,
ResScaleDown = configurationFileFormat.Hotkeys.ResScaleDown,
ToggleVsync = configurationFileFormat.HotkeysConfig.ToggleVsync,
Screenshot = configurationFileFormat.HotkeysConfig.Screenshot,
ShowUi = configurationFileFormat.HotkeysConfig.ShowUi,
Pause = configurationFileFormat.HotkeysConfig.Pause,
ToggleMute = configurationFileFormat.HotkeysConfig.ToggleMute,
ResScaleUp = configurationFileFormat.HotkeysConfig.ResScaleUp,
ResScaleDown = configurationFileFormat.HotkeysConfig.ResScaleDown,
VolumeUp = new Hotkey(Key.Unbound),
VolumeDown = new Hotkey(Key.Unbound)
};
@ -1317,7 +1317,7 @@ namespace Ryujinx.Ui.Common.Configuration
Ui.ShowConsole.Value = configurationFileFormat.ShowConsole;
Hid.EnableKeyboard.Value = configurationFileFormat.EnableKeyboard;
Hid.EnableMouse.Value = configurationFileFormat.EnableMouse;
Hid.Hotkeys.Value = configurationFileFormat.Hotkeys;
Hid.Hotkeys.Value = configurationFileFormat.HotkeysConfig;
Hid.InputConfig.Value = configurationFileFormat.InputConfig;
if (Hid.InputConfig.Value == null)