Add some more prototype serializers (#5934)
This commit is contained in:
@@ -7,6 +7,7 @@ using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
||||
|
||||
namespace Content.Shared.Lathe
|
||||
{
|
||||
@@ -18,7 +19,8 @@ namespace Content.Shared.Lathe
|
||||
|
||||
public override string Name => "ProtolatheDatabase";
|
||||
|
||||
[DataField("protolatherecipes")] private List<string> _recipeIds = new();
|
||||
[DataField("protolatherecipes", customTypeSerializer:typeof(PrototypeIdListSerializer<EntityPrototype>))]
|
||||
private List<string> _recipeIds = new();
|
||||
|
||||
/// <summary>
|
||||
/// A full list of recipes this protolathe can print.
|
||||
|
||||
@@ -5,6 +5,7 @@ using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.ViewVariables;
|
||||
@@ -27,7 +28,7 @@ namespace Content.Shared.Research.Prototypes
|
||||
[DataField("description")]
|
||||
private string _description = string.Empty;
|
||||
|
||||
[DataField("result")]
|
||||
[DataField("result", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
private string _result = string.Empty;
|
||||
|
||||
[DataField("completetime")]
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -56,7 +57,7 @@ namespace Content.Shared.Research.Prototypes
|
||||
/// A list of recipe IDs this technology unlocks.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[DataField("unlockedRecipes")]
|
||||
[DataField("unlockedRecipes", customTypeSerializer:typeof(PrototypeIdListSerializer<EntityPrototype>))]
|
||||
public List<string> UnlockedRecipes { get; } = new();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using Content.Shared.Access;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -48,7 +49,7 @@ namespace Content.Shared.Roles
|
||||
[DataField("head")]
|
||||
public bool IsHead { get; private set; }
|
||||
|
||||
[DataField("startingGear")]
|
||||
[DataField("startingGear", customTypeSerializer: typeof(PrototypeIdSerializer<StartingGearPrototype>))]
|
||||
public string? StartingGear { get; private set; }
|
||||
|
||||
[DataField("icon")] public string Icon { get; } = string.Empty;
|
||||
|
||||
@@ -6,6 +6,7 @@ using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
||||
|
||||
namespace Content.Shared.Whitelist
|
||||
{
|
||||
@@ -36,7 +37,8 @@ namespace Content.Shared.Whitelist
|
||||
/// <summary>
|
||||
/// Tags that are allowed in the whitelist.
|
||||
/// </summary>
|
||||
[DataField("tags")] public string[]? Tags = null;
|
||||
[DataField("tags")]
|
||||
public string[]? Tags = null;
|
||||
|
||||
void ISerializationHooks.AfterDeserialization()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user