diff --git a/CustomizePlus/Api/CustomizePlusIpc.Profile.cs b/CustomizePlus/Api/CustomizePlusIpc.Profile.cs index c95c24f..f16543e 100644 --- a/CustomizePlus/Api/CustomizePlusIpc.Profile.cs +++ b/CustomizePlus/Api/CustomizePlusIpc.Profile.cs @@ -23,6 +23,8 @@ namespace CustomizePlus.Api; public partial class CustomizePlusIpc { + private static JsonSerializerSettings _ipcProfileSerializerSettings = new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore }; + /// /// Triggered when changes in currently active profiles are detected. (like changing active profile or making any changes to it) /// Not triggered if any changes happen due to character no longer existing. @@ -88,7 +90,7 @@ public partial class CustomizePlusIpc try { - return ((int)ErrorCode.Success, JsonConvert.SerializeObject(convertedProfile)); + return ((int)ErrorCode.Success, JsonConvert.SerializeObject(convertedProfile, _ipcProfileSerializerSettings)); } catch (Exception ex) { diff --git a/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/IPCTestTab.cs b/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/IPCTestTab.cs index 05c8b47..88e45c9 100644 --- a/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/IPCTestTab.cs +++ b/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/IPCTestTab.cs @@ -27,6 +27,8 @@ public class IPCTestTab //: IDisposable { private const string _ownedTesProfile = "{\"Bones\":{\"n_root\":{\"Translation\":{\"X\":0.0,\"Y\":0.0,\"Z\":0.0},\"Rotation\":{\"X\":0.0,\"Y\":0.0,\"Z\":0.0},\"Scaling\":{\"X\":2.0,\"Y\":2.0,\"Z\":2.0}}}}"; + private static JsonSerializerSettings _ipcProfileSerializerSettings = new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore }; + private readonly IObjectTable _objectTable; private readonly ProfileManager _profileManager; private readonly PopupSystem _popupSystem; @@ -186,7 +188,7 @@ public class IPCTestTab //: IDisposable if (profile == null) return; - _rememberedProfileJson = JsonConvert.SerializeObject(IPCCharacterProfile.FromFullProfile(profile)); + _rememberedProfileJson = JsonConvert.SerializeObject(IPCCharacterProfile.FromFullProfile(profile), _ipcProfileSerializerSettings); _popupSystem.ShowPopup(PopupSystem.Messages.IPCProfileRemembered); }