aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx/Ui/Windows/ControllerWindow.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2023-03-21 20:14:46 -0300
committerGitHub <noreply@github.com>2023-03-21 20:14:46 -0300
commitba95ee54abf4905d38f3563881a1643f102993b3 (patch)
tree4a17ec5f209e64e4944b7deceec5dbdf1e0d9dc3 /Ryujinx/Ui/Windows/ControllerWindow.cs
parent4ce4299ca2a6b11332f2341c69f40efd7205282f (diff)
Revert "Use source generated json serializers in order to improve code trimming (#4094)" (#4576)1.1.675
This reverts commit 4ce4299ca2a6b11332f2341c69f40efd7205282f.
Diffstat (limited to 'Ryujinx/Ui/Windows/ControllerWindow.cs')
-rw-r--r--Ryujinx/Ui/Windows/ControllerWindow.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/Ryujinx/Ui/Windows/ControllerWindow.cs b/Ryujinx/Ui/Windows/ControllerWindow.cs
index 9b4befd8..0f0fba0b 100644
--- a/Ryujinx/Ui/Windows/ControllerWindow.cs
+++ b/Ryujinx/Ui/Windows/ControllerWindow.cs
@@ -115,8 +115,6 @@ namespace Ryujinx.Ui.Windows
private bool _mousePressed;
private bool _middleMousePressed;
- private static readonly InputConfigJsonSerializerContext SerializerContext = new(JsonHelper.GetDefaultSerializerOptions());
-
public ControllerWindow(MainWindow mainWindow, PlayerIndex controllerId) : this(mainWindow, new Builder("Ryujinx.Ui.Windows.ControllerWindow.glade"), controllerId) { }
private ControllerWindow(MainWindow mainWindow, Builder builder, PlayerIndex controllerId) : base(builder.GetRawOwnedObject("_controllerWin"))
@@ -1122,7 +1120,10 @@ namespace Ryujinx.Ui.Windows
try
{
- config = JsonHelper.DeserializeFromFile(path, SerializerContext.InputConfig);
+ using (Stream stream = File.OpenRead(path))
+ {
+ config = JsonHelper.Deserialize<InputConfig>(stream);
+ }
}
catch (JsonException) { }
}
@@ -1144,7 +1145,9 @@ namespace Ryujinx.Ui.Windows
if (profileDialog.Run() == (int)ResponseType.Ok)
{
string path = System.IO.Path.Combine(GetProfileBasePath(), profileDialog.FileName);
- string jsonString = JsonHelper.Serialize(inputConfig, SerializerContext.InputConfig);
+ string jsonString;
+
+ jsonString = JsonHelper.Serialize(inputConfig, true);
File.WriteAllText(path, jsonString);
}