Files
tbd-station-14/Content.Shared/Construction/Steps/ArbitraryInsertConstructionGraphStep.cs
E F R b2da936848 Everything: Rich text redux (#5625)
* lord save me

* UI/ChatBox: Use the new `defStyle` param for `RenderMarkup`

The previous iteration didn't work because `AddMessage` can't inherit
its color from the PushColor (since we're not doing actual tag stacks
anymore).

* rebase touchup
2021-12-12 18:25:42 -08:00

34 lines
1.1 KiB
C#

using Content.Shared.Examine;
using Robust.Shared.Localization;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
using Robust.Shared.Utility.Markup;
namespace Content.Shared.Construction.Steps
{
public abstract class ArbitraryInsertConstructionGraphStep : EntityInsertConstructionGraphStep
{
[DataField("name")] public string Name { get; private set; } = string.Empty;
[DataField("icon")] public SpriteSpecifier? Icon { get; private set; } = null;
public override void DoExamine(ExaminedEvent examinedEvent)
{
if (string.IsNullOrEmpty(Name))
return;
examinedEvent.Message.AddMessage(Basic.RenderMarkup(Loc.GetString("construction-insert-arbitrary-entity", ("stepName", Name))));
}
public override ConstructionGuideEntry GenerateGuideEntry()
{
return new ConstructionGuideEntry()
{
Localization = "construction-presenter-arbitrary-step",
Arguments = new (string, object)[]{("name", Name)},
Icon = Icon,
};
}
}
}