diff --git a/src/Ryujinx.Ava/UI/Helpers/KeyValueConverter.cs b/src/Ryujinx.Ava/UI/Helpers/KeyValueConverter.cs index efda8f07e..fae54a9cb 100644 --- a/src/Ryujinx.Ava/UI/Helpers/KeyValueConverter.cs +++ b/src/Ryujinx.Ava/UI/Helpers/KeyValueConverter.cs @@ -86,6 +86,16 @@ namespace Ryujinx.Ava.UI.Helpers { Key.Unbound, LocaleKeys.KeyUnbound }, }; + private static readonly Dictionary GamepadInputIdMap = new() + { + + }; + + private static readonly Dictionary StickInputIdMap = new() + { + + }; + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { string keyString = ""; @@ -103,11 +113,25 @@ namespace Ryujinx.Ava.UI.Helpers } else if (value is GamepadInputId gamepadInputId) { - keyString = value.ToString(); + if (GamepadInputIdMap.TryGetValue(gamepadInputId, out LocaleKeys localeKey)) + { + keyString = LocaleManager.Instance[localeKey]; + } + else + { + keyString = gamepadInputId.ToString(); + } } else if (value is StickInputId stickInputId) { - keyString = value.ToString(); + if (StickInputIdMap.TryGetValue(stickInputId, out LocaleKeys localeKey)) + { + keyString = LocaleManager.Instance[localeKey]; + } + else + { + keyString = stickInputId.ToString(); + } } return keyString; @@ -133,11 +157,27 @@ namespace Ryujinx.Ava.UI.Helpers } else if (targetType == typeof(GamepadInputId)) { - key = Enum.Parse(value.ToString()); + var optionalKey = GamepadInputIdMap.FirstOrOptional(x => LocaleManager.Instance[x.Value] == value.ToString()); + if (optionalKey.HasValue) + { + key = optionalKey.Value; + } + else + { + key = Enum.Parse(value.ToString()); + } } else if (targetType == typeof(StickInputId)) { - key = Enum.Parse(value.ToString()); + var optionalKey = StickInputIdMap.FirstOrOptional(x => LocaleManager.Instance[x.Value] == value.ToString()); + if (optionalKey.HasValue) + { + key = optionalKey.Value; + } + else + { + key = Enum.Parse(value.ToString()); + } } }