aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Ava/UI/ViewModels/ControllerSettingsViewModel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Ava/UI/ViewModels/ControllerSettingsViewModel.cs')
-rw-r--r--Ryujinx.Ava/UI/ViewModels/ControllerSettingsViewModel.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Ryujinx.Ava/UI/ViewModels/ControllerSettingsViewModel.cs b/Ryujinx.Ava/UI/ViewModels/ControllerSettingsViewModel.cs
index dd261b10..35256b3b 100644
--- a/Ryujinx.Ava/UI/ViewModels/ControllerSettingsViewModel.cs
+++ b/Ryujinx.Ava/UI/ViewModels/ControllerSettingsViewModel.cs
@@ -51,8 +51,6 @@ namespace Ryujinx.Ava.UI.ViewModels
private bool _isLoaded;
private readonly UserControl _owner;
- private static readonly InputConfigJsonSerializerContext SerializerContext = new(JsonHelper.GetDefaultSerializerOptions());
-
public IGamepadDriver AvaloniaKeyboardDriver { get; }
public IGamepad SelectedGamepad { get; private set; }
@@ -708,7 +706,10 @@ namespace Ryujinx.Ava.UI.ViewModels
try
{
- config = JsonHelper.DeserializeFromFile(path, SerializerContext.InputConfig);
+ using (Stream stream = File.OpenRead(path))
+ {
+ config = JsonHelper.Deserialize<InputConfig>(stream);
+ }
}
catch (JsonException) { }
catch (InvalidOperationException)
@@ -774,7 +775,7 @@ namespace Ryujinx.Ava.UI.ViewModels
config.ControllerType = Controllers[_controller].Type;
- string jsonString = JsonHelper.Serialize(config, SerializerContext.InputConfig);
+ string jsonString = JsonHelper.Serialize(config, true);
await File.WriteAllTextAsync(path, jsonString);