Add some more prototype serializers (#5934)

This commit is contained in:
metalgearsloth
2021-12-30 00:48:18 +11:00
committed by GitHub
parent 39e42899ca
commit 88bdf0ce61
24 changed files with 78 additions and 39 deletions

View File

@@ -15,6 +15,7 @@ using Robust.Shared.Log;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
namespace Content.Server.Actions.Spells namespace Content.Server.Actions.Spells
@@ -25,7 +26,7 @@ namespace Content.Server.Actions.Spells
{ //TODO: Needs to be an EntityPrototype for proper validation { //TODO: Needs to be an EntityPrototype for proper validation
[ViewVariables] [DataField("castMessage")] public string? CastMessage { get; set; } = default!; [ViewVariables] [DataField("castMessage")] public string? CastMessage { get; set; } = default!;
[ViewVariables] [DataField("cooldown")] public float CoolDown { get; set; } = 1f; [ViewVariables] [DataField("cooldown")] public float CoolDown { get; set; } = 1f;
[ViewVariables] [DataField("spellItem")] public string ItemProto { get; set; } = default!; [ViewVariables] [DataField("spellItem", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))] public string ItemProto { get; set; } = default!;
[ViewVariables] [DataField("castSound", required: true)] public SoundSpecifier CastSound { get; set; } = default!; [ViewVariables] [DataField("castSound", required: true)] public SoundSpecifier CastSound { get; set; } = default!;

View File

@@ -16,8 +16,10 @@ using Robust.Shared.IoC;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Maths; using Robust.Shared.Maths;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
namespace Content.Server.Arcade.Components namespace Content.Server.Arcade.Components
@@ -64,7 +66,7 @@ namespace Content.Server.Arcade.Components
"Vhakoid", "Peteoid", "slime", "Griefer", "ERPer", "Lizard Man", "Unicorn" "Vhakoid", "Peteoid", "slime", "Griefer", "ERPer", "Lizard Man", "Unicorn"
}; };
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[DataField("possibleRewards")] [DataField("possibleRewards", customTypeSerializer:typeof(PrototypeIdListSerializer<EntityPrototype>))]
private List<string> _possibleRewards = new List<string>() private List<string> _possibleRewards = new List<string>()
{ {
"ToyMouse", "ToyAi", "ToyNuke", "ToyAssistant", "ToyGriffin", "ToyHonk", "ToyIan", "ToyMouse", "ToyAi", "ToyNuke", "ToyAssistant", "ToyGriffin", "ToyHonk", "ToyIan",

View File

@@ -16,6 +16,7 @@ using Robust.Shared.Maths;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
@@ -103,7 +104,7 @@ namespace Content.Server.Botany
#region Output #region Output
[ViewVariables] [ViewVariables]
[DataField("productPrototypes")] [DataField("productPrototypes", customTypeSerializer:typeof(PrototypeIdListSerializer<EntityPrototype>))]
public List<string> ProductPrototypes { get; set; } = new(); public List<string> ProductPrototypes { get; set; } = new();
[ViewVariables] [ViewVariables]

View File

@@ -7,7 +7,9 @@ using Robust.Shared.Containers;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Log; using Robust.Shared.Log;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
namespace Content.Server.Computer namespace Content.Server.Computer
@@ -18,7 +20,7 @@ namespace Content.Server.Computer
[Dependency] private readonly IEntityManager _entMan = default!; [Dependency] private readonly IEntityManager _entMan = default!;
[ViewVariables] [ViewVariables]
[DataField("board")] [DataField("board", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
private string? _boardPrototype; private string? _boardPrototype;
protected override void Initialize() protected override void Initialize()

View File

@@ -5,7 +5,9 @@ using Content.Shared.Prototypes;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Construction.Completions namespace Content.Server.Construction.Completions
{ {
@@ -13,8 +15,10 @@ namespace Content.Server.Construction.Completions
[DataDefinition] [DataDefinition]
public class SpawnPrototype : IGraphAction public class SpawnPrototype : IGraphAction
{ {
[DataField("prototype")] public string Prototype { get; private set; } = string.Empty; [DataField("prototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
[DataField("amount")] public int Amount { get; private set; } = 1; public string Prototype { get; private set; } = string.Empty;
[DataField("amount")]
public int Amount { get; private set; } = 1;
public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
{ {

View File

@@ -9,8 +9,10 @@ using Robust.Shared.Containers;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Maths; using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
namespace Content.Server.Explosion.Components namespace Content.Server.Explosion.Components
@@ -27,7 +29,7 @@ namespace Content.Server.Explosion.Components
/// <summary> /// <summary>
/// What we fill our prototype with if we want to pre-spawn with grenades. /// What we fill our prototype with if we want to pre-spawn with grenades.
/// </summary> /// </summary>
[ViewVariables] [DataField("fillPrototype")] [ViewVariables] [DataField("fillPrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
private string? _fillPrototype; private string? _fillPrototype;
/// <summary> /// <summary>

View File

@@ -19,7 +19,9 @@ using Robust.Shared.Localization;
using Robust.Shared.Maths; using Robust.Shared.Maths;
using Robust.Shared.Physics; using Robust.Shared.Physics;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Timing; using Robust.Shared.Timing;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
@@ -44,7 +46,7 @@ namespace Content.Server.Fluids.Components
private TimeSpan _cooldownEnd; private TimeSpan _cooldownEnd;
[DataField("cooldownTime")] [DataField("cooldownTime")]
private float _cooldownTime = 0.5f; private float _cooldownTime = 0.5f;
[DataField("sprayedPrototype")] [DataField("sprayedPrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
private string _vaporPrototype = "Vapor"; private string _vaporPrototype = "Vapor";
[DataField("vaporAmount")] [DataField("vaporAmount")]
private int _vaporAmount = 1; private int _vaporAmount = 1;

View File

@@ -19,7 +19,9 @@ using Robust.Shared.Localization;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Maths; using Robust.Shared.Maths;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
@@ -38,7 +40,7 @@ namespace Content.Server.Morgue.Components
public override string Name => "MorgueEntityStorage"; public override string Name => "MorgueEntityStorage";
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[DataField("trayPrototype")] [DataField("trayPrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
private string? _trayPrototypeId; private string? _trayPrototypeId;
[ViewVariables] [ViewVariables]

View File

@@ -1,14 +1,16 @@
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Tabletop namespace Content.Server.Tabletop
{ {
[UsedImplicitly] [UsedImplicitly]
public class TabletopChessSetup : TabletopSetup public class TabletopChessSetup : TabletopSetup
{ {
[DataField("boardPrototype")] [DataField("boardPrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string ChessBoardPrototype { get; } = "ChessBoardTabletop"; public string ChessBoardPrototype { get; } = "ChessBoardTabletop";
// TODO: Un-hardcode the rest of entity prototype IDs, probably. // TODO: Un-hardcode the rest of entity prototype IDs, probably.

View File

@@ -1,25 +1,27 @@
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Tabletop namespace Content.Server.Tabletop
{ {
[UsedImplicitly] [UsedImplicitly]
public class TabletopParchisSetup : TabletopSetup public class TabletopParchisSetup : TabletopSetup
{ {
[DataField("boardPrototype")] [DataField("boardPrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string ParchisBoardPrototype { get; } = "ParchisBoardTabletop"; public string ParchisBoardPrototype { get; } = "ParchisBoardTabletop";
[DataField("redPiecePrototype")] [DataField("redPiecePrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string RedPiecePrototype { get; } = "RedTabletopPiece"; public string RedPiecePrototype { get; } = "RedTabletopPiece";
[DataField("greenPiecePrototype")] [DataField("greenPiecePrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string GreenPiecePrototype { get; } = "GreenTabletopPiece"; public string GreenPiecePrototype { get; } = "GreenTabletopPiece";
[DataField("yellowPiecePrototype")] [DataField("yellowPiecePrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string YellowPiecePrototype { get; } = "YellowTabletopPiece"; public string YellowPiecePrototype { get; } = "YellowTabletopPiece";
[DataField("bluePiecePrototype")] [DataField("bluePiecePrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string BluePiecePrototype { get; } = "BlueTabletopPiece"; public string BluePiecePrototype { get; } = "BlueTabletopPiece";
public override void SetupTabletop(TabletopSession session, IEntityManager entityManager) public override void SetupTabletop(TabletopSession session, IEntityManager entityManager)

View File

@@ -12,7 +12,9 @@ using Robust.Shared.Containers;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Utility; using Robust.Shared.Utility;
namespace Content.Server.Weapon.Ranged.Ammunition.Components namespace Content.Server.Weapon.Ranged.Ammunition.Components
@@ -44,7 +46,7 @@ namespace Content.Server.Weapon.Ranged.Ammunition.Components
private AppearanceComponent? _appearanceComponent; private AppearanceComponent? _appearanceComponent;
// If there's anything already in the magazine // If there's anything already in the magazine
[DataField("fillPrototype")] [DataField("fillPrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
private string? _fillPrototype; private string? _fillPrototype;
// By default the magazine won't spawn the entity until needed so we need to keep track of how many left we can spawn // By default the magazine won't spawn the entity until needed so we need to keep track of how many left we can spawn

View File

@@ -10,7 +10,9 @@ using Robust.Shared.Containers;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Weapon.Ranged.Ammunition.Components namespace Content.Server.Weapon.Ranged.Ammunition.Components
{ {
@@ -35,8 +37,8 @@ namespace Content.Server.Weapon.Ranged.Ammunition.Components
public int AmmoLeft => _spawnedAmmo.Count + _unspawnedCount; public int AmmoLeft => _spawnedAmmo.Count + _unspawnedCount;
[DataField("fillPrototype")] [DataField("fillPrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
private string? _fillPrototype = default; private string? _fillPrototype;
protected override void Initialize() protected override void Initialize()
{ {

View File

@@ -14,7 +14,9 @@ using Robust.Shared.IoC;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
@@ -55,7 +57,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
private BallisticCaliber _caliber = BallisticCaliber.Unspecified; private BallisticCaliber _caliber = BallisticCaliber.Unspecified;
[ViewVariables] [ViewVariables]
[DataField("fillPrototype")] [DataField("fillPrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
private string? _fillPrototype; private string? _fillPrototype;
[ViewVariables] [ViewVariables]
private int _unspawnedCount; private int _unspawnedCount;

View File

@@ -13,9 +13,11 @@ using Robust.Shared.IoC;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
namespace Content.Server.Weapon.Ranged.Barrels.Components namespace Content.Server.Weapon.Ranged.Barrels.Components
@@ -48,7 +50,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
public override int ShotsLeft => _ammoContainer.ContainedEntities.Count; public override int ShotsLeft => _ammoContainer.ContainedEntities.Count;
[ViewVariables] [ViewVariables]
[DataField("fillPrototype")] [DataField("fillPrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
private string? _fillPrototype; private string? _fillPrototype;
[ViewVariables] [ViewVariables]

View File

@@ -10,7 +10,9 @@ using Robust.Shared.IoC;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Players; using Robust.Shared.Players;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
namespace Content.Server.Weapon.Ranged.Barrels.Components namespace Content.Server.Weapon.Ranged.Barrels.Components
@@ -32,7 +34,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
[DataField("fireCost")] [DataField("fireCost")]
[ViewVariables] private int _baseFireCost = 300; [ViewVariables] private int _baseFireCost = 300;
// What gets fired // What gets fired
[DataField("ammoPrototype")] [DataField("ammoPrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
[ViewVariables] private string? _ammoPrototype; [ViewVariables] private string? _ammoPrototype;
public BatteryComponent? PowerCell => _entities.GetComponentOrNull<BatteryComponent>(CellSlot.Item); public BatteryComponent? PowerCell => _entities.GetComponentOrNull<BatteryComponent>(CellSlot.Item);

View File

@@ -18,7 +18,9 @@ using Robust.Shared.IoC;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
@@ -80,7 +82,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
} }
} }
[DataField("magFillPrototype")] [DataField("magFillPrototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
private string? _magFillPrototype; private string? _magFillPrototype;
public bool BoltOpen public bool BoltOpen

View File

@@ -7,6 +7,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Lathe namespace Content.Shared.Lathe
{ {
@@ -18,7 +19,8 @@ namespace Content.Shared.Lathe
public override string Name => "ProtolatheDatabase"; public override string Name => "ProtolatheDatabase";
[DataField("protolatherecipes")] private List<string> _recipeIds = new(); [DataField("protolatherecipes", customTypeSerializer:typeof(PrototypeIdListSerializer<EntityPrototype>))]
private List<string> _recipeIds = new();
/// <summary> /// <summary>
/// A full list of recipes this protolathe can print. /// A full list of recipes this protolathe can print.

View File

@@ -5,6 +5,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes; 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.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
@@ -27,7 +28,7 @@ namespace Content.Shared.Research.Prototypes
[DataField("description")] [DataField("description")]
private string _description = string.Empty; private string _description = string.Empty;
[DataField("result")] [DataField("result", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
private string _result = string.Empty; private string _result = string.Empty;
[DataField("completetime")] [DataField("completetime")]

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
@@ -56,7 +57,7 @@ namespace Content.Shared.Research.Prototypes
/// A list of recipe IDs this technology unlocks. /// A list of recipe IDs this technology unlocks.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
[DataField("unlockedRecipes")] [DataField("unlockedRecipes", customTypeSerializer:typeof(PrototypeIdListSerializer<EntityPrototype>))]
public List<string> UnlockedRecipes { get; } = new(); public List<string> UnlockedRecipes { get; } = new();
} }
} }

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using Content.Shared.Access; using Content.Shared.Access;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes; 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.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
@@ -48,7 +49,7 @@ namespace Content.Shared.Roles
[DataField("head")] [DataField("head")]
public bool IsHead { get; private set; } public bool IsHead { get; private set; }
[DataField("startingGear")] [DataField("startingGear", customTypeSerializer: typeof(PrototypeIdSerializer<StartingGearPrototype>))]
public string? StartingGear { get; private set; } public string? StartingGear { get; private set; }
[DataField("icon")] public string Icon { get; } = string.Empty; [DataField("icon")] public string Icon { get; } = string.Empty;

View File

@@ -6,6 +6,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Log; using Robust.Shared.Log;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Whitelist namespace Content.Shared.Whitelist
{ {
@@ -36,7 +37,8 @@ namespace Content.Shared.Whitelist
/// <summary> /// <summary>
/// Tags that are allowed in the whitelist. /// Tags that are allowed in the whitelist.
/// </summary> /// </summary>
[DataField("tags")] public string[]? Tags = null; [DataField("tags")]
public string[]? Tags = null;
void ISerializationHooks.AfterDeserialization() void ISerializationHooks.AfterDeserialization()
{ {

View File

@@ -42,8 +42,8 @@
requiredTechnologies: requiredTechnologies:
- BasicResearch - BasicResearch
unlockedRecipes: unlockedRecipes:
- Scythe - HydroponicsToolScythe
- Hatchet - HydroponicsToolHatchet
- KitchenKnife - KitchenKnife
- type: technology - type: technology
@@ -75,7 +75,7 @@
- Retractor - Retractor
- Cautery - Cautery
- Drill - Drill
- BoneSaw - Saw
- Hemostat - Hemostat
# Chemistry Technology Tree # Chemistry Technology Tree
@@ -219,7 +219,7 @@
requiredTechnologies: requiredTechnologies:
- BasicResearch - BasicResearch
unlockedRecipes: unlockedRecipes:
- ConveyorAssembly - ConveyorBeltAssembly
- RCD - RCD
- RCDAmmo - RCDAmmo
- FlashlightLantern - FlashlightLantern
@@ -239,7 +239,7 @@
- SheetSteel - SheetSteel
- SheetPlastic - SheetPlastic
- SheetRGlass - SheetRGlass
- GlassStack - SheetGlass1
# Electromagnetic Theory Technology Tree # Electromagnetic Theory Technology Tree

View File

@@ -137,23 +137,23 @@
- LightTube - LightTube
- LightBulb - LightBulb
- SheetSteel - SheetSteel
- GlassStack - SheetGlass1
- SheetRGlass - SheetRGlass
- SheetPlastic - SheetPlastic
- CableStack - CableStack
- CableMVStack - CableMVStack
- CableHVStack - CableHVStack
- ConveyorAssembly - ConveyorBeltAssembly
- RCD - RCD
- RCDAmmo - RCDAmmo
- Scythe - HydroponicsToolScythe
- Hatchet - HydroponicsToolHatchet
- Shovel - Shovel
- Scalpel - Scalpel
- Retractor - Retractor
- Cautery - Cautery
- Drill - Drill
- BoneSaw - Saw
- Hemostat - Hemostat
- Beaker - Beaker
- LargeBeaker - LargeBeaker

View File

@@ -26,9 +26,9 @@
Glass: 100 Glass: 100
- type: latheRecipe - type: latheRecipe
id: GlowStickRed id: GlowstickRed
icon: Objects/Misc/glowstick.rsi icon: Objects/Misc/glowstick.rsi
result: GlowStickRed result: GlowstickRed
completetime: 500 completetime: 500
materials: materials:
Plastic: 50 Plastic: 50