Optimize IPC jsons
This commit is contained in:
@@ -23,6 +23,8 @@ namespace CustomizePlus.Api;
|
|||||||
|
|
||||||
public partial class CustomizePlusIpc
|
public partial class CustomizePlusIpc
|
||||||
{
|
{
|
||||||
|
private static JsonSerializerSettings _ipcProfileSerializerSettings = new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore };
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Triggered when changes in currently active profiles are detected. (like changing active profile or making any changes to it)
|
/// 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.
|
/// Not triggered if any changes happen due to character no longer existing.
|
||||||
@@ -88,7 +90,7 @@ public partial class CustomizePlusIpc
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return ((int)ErrorCode.Success, JsonConvert.SerializeObject(convertedProfile));
|
return ((int)ErrorCode.Success, JsonConvert.SerializeObject(convertedProfile, _ipcProfileSerializerSettings));
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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 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 IObjectTable _objectTable;
|
||||||
private readonly ProfileManager _profileManager;
|
private readonly ProfileManager _profileManager;
|
||||||
private readonly PopupSystem _popupSystem;
|
private readonly PopupSystem _popupSystem;
|
||||||
@@ -186,7 +188,7 @@ public class IPCTestTab //: IDisposable
|
|||||||
if (profile == null)
|
if (profile == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_rememberedProfileJson = JsonConvert.SerializeObject(IPCCharacterProfile.FromFullProfile(profile));
|
_rememberedProfileJson = JsonConvert.SerializeObject(IPCCharacterProfile.FromFullProfile(profile), _ipcProfileSerializerSettings);
|
||||||
_popupSystem.ShowPopup(PopupSystem.Messages.IPCProfileRemembered);
|
_popupSystem.ShowPopup(PopupSystem.Messages.IPCProfileRemembered);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user