Files
tbd-station-14/Content.Shared/Construction/PrototypeConstructionGraphStep.cs
2021-05-04 15:37:16 +02:00

33 lines
1.0 KiB
C#

#nullable enable
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
namespace Content.Shared.Construction
{
[DataDefinition]
public class PrototypeConstructionGraphStep : ArbitraryInsertConstructionGraphStep
{
[DataField("prototype")] public string Prototype { get; } = string.Empty;
public override bool EntityValid(IEntity entity)
{
return entity.Prototype?.ID == Prototype;
}
public override void DoExamine(FormattedMessage message, bool inDetailsRange)
{
message.AddMarkup(string.IsNullOrEmpty(Name)
? Loc.GetString(
"construction-insert-prototype-no-name",
("prototypeName", Prototype) // Terrible.
)
: Loc.GetString(
"construction-insert-prototype",
("entityName", Name)
));
}
}
}