Removes prototype construction steps (I HATE PROTOTYPE STEPS) (#11611)
This commit is contained in:
@@ -20,11 +20,6 @@ namespace Content.Shared.Construction.Steps
|
||||
return typeof(ToolConstructionGraphStep);
|
||||
}
|
||||
|
||||
if (node.Has("prototype"))
|
||||
{
|
||||
return typeof(PrototypeConstructionGraphStep);
|
||||
}
|
||||
|
||||
if (node.Has("component"))
|
||||
{
|
||||
return typeof(ComponentConstructionGraphStep);
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
using Content.Shared.Examine;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Shared.Construction.Steps
|
||||
{
|
||||
[DataDefinition]
|
||||
public sealed class PrototypeConstructionGraphStep : ArbitraryInsertConstructionGraphStep
|
||||
{
|
||||
[DataField("prototype", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>), required:true)]
|
||||
public string Prototype { get; } = string.Empty;
|
||||
|
||||
public override bool EntityValid(EntityUid uid, IEntityManager entityManager)
|
||||
{
|
||||
return entityManager.GetComponent<MetaDataComponent>(uid).EntityPrototype?.ID == Prototype;
|
||||
}
|
||||
|
||||
public override void DoExamine(ExaminedEvent examinedEvent)
|
||||
{
|
||||
examinedEvent.Message.AddMarkup(string.IsNullOrEmpty(Name)
|
||||
? Loc.GetString(
|
||||
"construction-insert-prototype-no-name",
|
||||
("prototypeName", Prototype) // Terrible.
|
||||
)
|
||||
: Loc.GetString(
|
||||
"construction-insert-prototype",
|
||||
("entityName", Name)
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,11 @@ namespace Content.Shared.Construction.Steps
|
||||
public sealed class TagConstructionGraphStep : ArbitraryInsertConstructionGraphStep
|
||||
{
|
||||
[DataField("tag")]
|
||||
private string? _tag = null;
|
||||
private string? _tag;
|
||||
|
||||
public override bool EntityValid(EntityUid uid, IEntityManager entityManager)
|
||||
{
|
||||
var tagSystem = EntitySystem.Get<TagSystem>();
|
||||
var tagSystem = entityManager.EntitySysManager.GetEntitySystem<TagSystem>();
|
||||
return !string.IsNullOrEmpty(_tag) && tagSystem.HasTag(uid, _tag);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user