Port all construction conditions to the new examine.
This commit is contained in:
@@ -2,6 +2,7 @@ using System.Threading.Tasks;
|
||||
using Content.Server.GameObjects.Components;
|
||||
using Content.Server.WireHacking;
|
||||
using Content.Shared.Construction;
|
||||
using Content.Shared.Examine;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Localization;
|
||||
@@ -23,17 +24,19 @@ namespace Content.Server.Construction.Conditions
|
||||
return wires.IsPanelOpen == Open;
|
||||
}
|
||||
|
||||
public bool DoExamine(IEntity entity, FormattedMessage message, bool inDetailsRange)
|
||||
public bool DoExamine(ExaminedEvent args)
|
||||
{
|
||||
var entity = args.Examined;
|
||||
|
||||
if (!entity.TryGetComponent(out WiresComponent? wires)) return false;
|
||||
|
||||
switch (Open)
|
||||
{
|
||||
case true when !wires.IsPanelOpen:
|
||||
message.AddMarkup(Loc.GetString("construction-condition-wire-panel-open") + "\n");
|
||||
args.PushMarkup(Loc.GetString("construction-condition-wire-panel-open"));
|
||||
return true;
|
||||
case false when wires.IsPanelOpen:
|
||||
message.AddMarkup(Loc.GetString("construction-condition-wire-panel-close") + "\n");
|
||||
args.PushMarkup(Loc.GetString("construction-condition-wire-panel-close"));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user