* Initial prediction * new group handling * groups for all examines that use multiple rn * compile * why was it doing this?? * handle newlines with sorting properly
33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using Content.Shared.Examine;
|
|
|
|
namespace Content.Shared.Construction.Steps
|
|
{
|
|
[DataDefinition]
|
|
public sealed partial class ComponentConstructionGraphStep : ArbitraryInsertConstructionGraphStep
|
|
{
|
|
[DataField("component")] public string Component { get; private set; } = string.Empty;
|
|
|
|
public override bool EntityValid(EntityUid uid, IEntityManager entityManager, IComponentFactory compFactory)
|
|
{
|
|
foreach (var component in entityManager.GetComponents(uid))
|
|
{
|
|
if (compFactory.GetComponentName(component.GetType()) == Component)
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public override void DoExamine(ExaminedEvent examinedEvent)
|
|
{
|
|
examinedEvent.PushMarkup(string.IsNullOrEmpty(Name)
|
|
? Loc.GetString(
|
|
"construction-insert-entity-with-component",
|
|
("componentName", Component))// Terrible.
|
|
: Loc.GetString(
|
|
"construction-insert-exact-entity",
|
|
("entityName", Name)));
|
|
}
|
|
}
|
|
}
|