summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Framework/Serialisation/JsonHelper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/StardewModdingAPI/Framework/Serialisation/JsonHelper.cs')
-rw-r--r--src/StardewModdingAPI/Framework/Serialisation/JsonHelper.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/StardewModdingAPI/Framework/Serialisation/JsonHelper.cs b/src/StardewModdingAPI/Framework/Serialisation/JsonHelper.cs
index 26d937a5..d5f5bfd0 100644
--- a/src/StardewModdingAPI/Framework/Serialisation/JsonHelper.cs
+++ b/src/StardewModdingAPI/Framework/Serialisation/JsonHelper.cs
@@ -1,5 +1,7 @@
using System;
+using System.Collections.Generic;
using System.IO;
+using Microsoft.Xna.Framework.Input;
using Newtonsoft.Json;
using StardewModdingAPI.Advanced;
@@ -15,7 +17,11 @@ namespace StardewModdingAPI.Framework.Serialisation
private readonly JsonSerializerSettings JsonSettings = new JsonSerializerSettings
{
Formatting = Formatting.Indented,
- ObjectCreationHandling = ObjectCreationHandling.Replace // avoid issue where default ICollection<T> values are duplicated each time the config is loaded
+ ObjectCreationHandling = ObjectCreationHandling.Replace, // avoid issue where default ICollection<T> values are duplicated each time the config is loaded
+ Converters = new List<JsonConverter>
+ {
+ new SelectiveStringEnumConverter(typeof(Buttons), typeof(Keys))
+ }
};