ECS-ify Construction[Ghost]Component IExamine.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Robust.Shared.Localization;
|
||||
using Content.Shared.Examine;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
@@ -10,10 +11,12 @@ namespace Content.Shared.Construction.Steps
|
||||
|
||||
[DataField("icon")] public SpriteSpecifier Icon { get; private set; } = SpriteSpecifier.Invalid;
|
||||
|
||||
public override void DoExamine(FormattedMessage message, bool inDetailsRange)
|
||||
public override void DoExamine(ExaminedEvent examinedEvent)
|
||||
{
|
||||
if (string.IsNullOrEmpty(Name)) return;
|
||||
message.AddMarkup(Loc.GetString("construction-insert-arbitrary-entity", ("stepName", Name)));
|
||||
if (string.IsNullOrEmpty(Name))
|
||||
return;
|
||||
|
||||
examinedEvent.Message.AddMarkup(Loc.GetString("construction-insert-arbitrary-entity", ("stepName", Name)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using Content.Shared.Examine;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.Construction.Steps
|
||||
{
|
||||
@@ -21,9 +21,9 @@ namespace Content.Shared.Construction.Steps
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void DoExamine(FormattedMessage message, bool inDetailsRange)
|
||||
public override void DoExamine(ExaminedEvent examinedEvent)
|
||||
{
|
||||
message.AddMarkup(string.IsNullOrEmpty(Name)
|
||||
examinedEvent.Message.AddMarkup(string.IsNullOrEmpty(Name)
|
||||
? Loc.GetString(
|
||||
"construction-insert-entity-with-component",
|
||||
("componentName", Component))// Terrible.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.Examine;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.Construction.Steps
|
||||
{
|
||||
@@ -15,6 +15,6 @@ namespace Content.Shared.Construction.Steps
|
||||
|
||||
public IReadOnlyList<IGraphAction> Completed => _completed;
|
||||
|
||||
public abstract void DoExamine(FormattedMessage message, bool inDetailsRange);
|
||||
public abstract void DoExamine(ExaminedEvent examinedEvent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Stacks;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.Construction.Steps
|
||||
{
|
||||
@@ -21,9 +21,9 @@ namespace Content.Shared.Construction.Steps
|
||||
public StackPrototype MaterialPrototype =>
|
||||
IoCManager.Resolve<IPrototypeManager>().Index<StackPrototype>(MaterialPrototypeId);
|
||||
|
||||
public override void DoExamine(FormattedMessage message, bool inDetailsRange)
|
||||
public override void DoExamine(ExaminedEvent examinedEvent)
|
||||
{
|
||||
message.AddMarkup(Loc.GetString("construction-insert-material-entity", ("amount", Amount), ("materialName", MaterialPrototype.Name)));
|
||||
examinedEvent.Message.AddMarkup(Loc.GetString("construction-insert-material-entity", ("amount", Amount), ("materialName", MaterialPrototype.Name)));
|
||||
}
|
||||
|
||||
public override bool EntityValid(IEntity entity)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Content.Shared.Examine;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.Construction.Steps
|
||||
{
|
||||
@@ -20,7 +20,7 @@ namespace Content.Shared.Construction.Steps
|
||||
}
|
||||
}
|
||||
|
||||
public override void DoExamine(FormattedMessage message, bool inDetailsRange)
|
||||
public override void DoExamine(ExaminedEvent examinedEvent)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using Content.Shared.Examine;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.Construction.Steps
|
||||
{
|
||||
@@ -15,9 +15,9 @@ namespace Content.Shared.Construction.Steps
|
||||
return entity.Prototype?.ID == Prototype;
|
||||
}
|
||||
|
||||
public override void DoExamine(FormattedMessage message, bool inDetailsRange)
|
||||
public override void DoExamine(ExaminedEvent examinedEvent)
|
||||
{
|
||||
message.AddMarkup(string.IsNullOrEmpty(Name)
|
||||
examinedEvent.Message.AddMarkup(string.IsNullOrEmpty(Name)
|
||||
? Loc.GetString(
|
||||
"construction-insert-prototype-no-name",
|
||||
("prototypeName", Prototype) // Terrible.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Tool;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
@@ -14,15 +15,15 @@ namespace Content.Shared.Construction.Steps
|
||||
|
||||
[DataField("examine")] public string ExamineOverride { get; } = string.Empty;
|
||||
|
||||
public override void DoExamine(FormattedMessage message, bool inDetailsRange)
|
||||
public override void DoExamine(ExaminedEvent examinedEvent)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ExamineOverride))
|
||||
{
|
||||
message.AddMarkup(Loc.GetString(ExamineOverride));
|
||||
examinedEvent.Message.AddMarkup(Loc.GetString(ExamineOverride));
|
||||
return;
|
||||
}
|
||||
|
||||
message.AddMarkup(Loc.GetString("construction-use-tool-entity", ("toolName", Tool.GetToolName())));
|
||||
examinedEvent.Message.AddMarkup(Loc.GetString("construction-use-tool-entity", ("toolName", Tool.GetToolName())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user