Port all construction conditions to the new examine.

This commit is contained in:
Vera Aguilera Puerto
2021-10-01 15:27:42 +02:00
parent f21c921c56
commit 3b14c21396
15 changed files with 85 additions and 40 deletions

View File

@@ -6,6 +6,7 @@ using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
using System.Threading.Tasks;
using Content.Server.Doors.Components;
using Content.Shared.Examine;
namespace Content.Server.Construction.Conditions
{
@@ -23,16 +24,18 @@ namespace Content.Server.Construction.Conditions
return airlock.BoltsDown == Value;
}
public bool DoExamine(IEntity entity, FormattedMessage message, bool inDetailsRange)
public bool DoExamine(ExaminedEvent args)
{
var entity = args.Examined;
if (!entity.TryGetComponent(out AirlockComponent? airlock)) return false;
if (airlock.BoltsDown != Value)
{
if (Value == true)
message.AddMarkup(Loc.GetString("construction-condition-airlock-bolt", ("entityName", entity.Name)) + "\n");
args.PushMarkup(Loc.GetString("construction-condition-airlock-bolt", ("entityName", entity.Name)) + "\n");
else
message.AddMarkup(Loc.GetString("construction-condition-airlock-unbolt", ("entityName", entity.Name)) + "\n");
args.PushMarkup(Loc.GetString("construction-condition-airlock-unbolt", ("entityName", entity.Name)) + "\n");
return true;
}