2023-08-12 17:39:58 -04:00
|
|
|
using Content.Shared.Construction.Components;
|
|
|
|
|
using Content.Shared.Examine;
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Construction.Steps;
|
|
|
|
|
|
|
|
|
|
[DataDefinition]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class PartAssemblyConstructionGraphStep : ConstructionGraphStep
|
2023-08-12 17:39:58 -04:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A valid ID on <see cref="PartAssemblyComponent"/>'s dictionary of strings to part lists.
|
|
|
|
|
/// </summary>
|
2023-10-10 20:06:24 -07:00
|
|
|
[DataField]
|
2023-08-12 17:39:58 -04:00
|
|
|
public string AssemblyId = string.Empty;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2023-10-10 20:06:24 -07:00
|
|
|
/// A localization string used when examining and for the guidebook.
|
2023-08-12 17:39:58 -04:00
|
|
|
/// </summary>
|
2023-10-10 20:06:24 -07:00
|
|
|
[DataField]
|
|
|
|
|
public LocId GuideString = "construction-guide-condition-part-assembly";
|
2023-08-12 17:39:58 -04:00
|
|
|
|
|
|
|
|
public bool Condition(EntityUid uid, IEntityManager entityManager)
|
|
|
|
|
{
|
|
|
|
|
return entityManager.System<PartAssemblySystem>().IsAssemblyFinished(uid, AssemblyId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void DoExamine(ExaminedEvent args)
|
|
|
|
|
{
|
|
|
|
|
args.PushMarkup(Loc.GetString(GuideString));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override ConstructionGuideEntry GenerateGuideEntry()
|
|
|
|
|
{
|
|
|
|
|
return new ConstructionGuideEntry
|
|
|
|
|
{
|
|
|
|
|
Localization = GuideString,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|