diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2023-03-21 20:14:46 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-21 20:14:46 -0300 |
| commit | ba95ee54abf4905d38f3563881a1643f102993b3 (patch) | |
| tree | 4a17ec5f209e64e4944b7deceec5dbdf1e0d9dc3 /Ryujinx.Ava/UI/ViewModels/ControllerSettingsViewModel.cs | |
| parent | 4ce4299ca2a6b11332f2341c69f40efd7205282f (diff) | |
Revert "Use source generated json serializers in order to improve code trimming (#4094)" (#4576)
This reverts commit 4ce4299ca2a6b11332f2341c69f40efd7205282f.
Diffstat (limited to 'Ryujinx.Ava/UI/ViewModels/ControllerSettingsViewModel.cs')
| -rw-r--r-- | Ryujinx.Ava/UI/ViewModels/ControllerSettingsViewModel.cs | 9 |
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); |
