Examinable Anchors (#8407)

This commit is contained in:
ShuttleEnjoyer
2022-05-30 04:55:54 -04:00
committed by GitHub
parent 5f9f319d5a
commit 2bbb52d5a2
3 changed files with 13 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ using Content.Server.Tools;
using Content.Shared.Construction.Components;
using Content.Shared.Construction.EntitySystems;
using Content.Shared.Database;
using Content.Shared.Examine;
using Content.Shared.Pulling.Components;
using Content.Shared.Tools.Components;
@@ -25,6 +26,14 @@ namespace Content.Server.Construction
SubscribeLocalEvent<AnchorableComponent, TryAnchorCancelledEvent>(OnAnchorCancelled2);
SubscribeLocalEvent<AnchorableComponent, TryUnanchorCompletedEvent>(OnUnanchorComplete2);
SubscribeLocalEvent<AnchorableComponent, TryUnanchorCancelledEvent>(OnUnanchorCancelled2);
SubscribeLocalEvent<AnchorableComponent, ExaminedEvent>(OnAnchoredExamine);
}
private void OnAnchoredExamine(EntityUid uid, AnchorableComponent component, ExaminedEvent args)
{
var isAnchored = Comp<TransformComponent>(uid).Anchored;
var messageId = isAnchored ? "examinable-anchored" : "examinable-unanchored";
args.PushMarkup(Loc.GetString(messageId, ("target", uid)));
}
private void OnUnanchorCancelled2(EntityUid uid, AnchorableComponent component, TryUnanchorCancelledEvent args)

View File

@@ -3,4 +3,3 @@
# Shown when the battery is examined in details range
examinable-battery-component-examine-detail = The battery is [color={$markupPercentColor}]{$percent}%[/color] full.

View File

@@ -3,3 +3,7 @@
examine-system-entity-does-not-exist = That entity doesn't exist
examine-verb-name = Basic
examinable-anchored = It is anchored to the floor
examinable-unanchored = It is unanchored from the floor