2021-02-27 04:12:09 +01:00
|
|
|
|
#nullable enable
|
2021-02-22 00:07:46 +00:00
|
|
|
|
using Robust.Shared.GameObjects;
|
2020-10-08 17:41:23 +02:00
|
|
|
|
using Robust.Shared.Localization;
|
2021-03-05 01:08:38 +01:00
|
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
2020-10-08 17:41:23 +02:00
|
|
|
|
using Robust.Shared.Utility;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Construction
|
|
|
|
|
|
{
|
2021-03-05 01:08:38 +01:00
|
|
|
|
[DataDefinition]
|
2020-10-08 17:41:23 +02:00
|
|
|
|
public class PrototypeConstructionGraphStep : ArbitraryInsertConstructionGraphStep
|
|
|
|
|
|
{
|
2021-05-04 15:37:16 +02:00
|
|
|
|
[DataField("prototype")] public string Prototype { get; } = string.Empty;
|
2020-10-08 17:41:23 +02:00
|
|
|
|
|
|
|
|
|
|
public override bool EntityValid(IEntity entity)
|
|
|
|
|
|
{
|
|
|
|
|
|
return entity.Prototype?.ID == Prototype;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void DoExamine(FormattedMessage message, bool inDetailsRange)
|
|
|
|
|
|
{
|
|
|
|
|
|
message.AddMarkup(string.IsNullOrEmpty(Name)
|
2021-02-22 00:07:46 +00:00
|
|
|
|
? Loc.GetString(
|
|
|
|
|
|
"construction-insert-prototype-no-name",
|
|
|
|
|
|
("prototypeName", Prototype) // Terrible.
|
|
|
|
|
|
)
|
|
|
|
|
|
: Loc.GetString(
|
|
|
|
|
|
"construction-insert-prototype",
|
|
|
|
|
|
("entityName", Name)
|
|
|
|
|
|
));
|
2020-10-08 17:41:23 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|