Files
wwdpublic/Content.Shared/Labels/EntitySystems/SharedLabelSystem.cs
Tayrtahn c255822389 Add prediction to hand labeler labels (#25869)
Added prediction to labels

(cherry picked from commit f4976a32886850df2033e7866d0c9a5df37be1af)
2024-03-07 01:27:58 +01:00

29 lines
760 B
C#

using Content.Shared.Examine;
using Content.Shared.Labels.Components;
using Robust.Shared.Utility;
namespace Content.Shared.Labels.EntitySystems;
public abstract partial class SharedLabelSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<LabelComponent, ExaminedEvent>(OnExamine);
}
private void OnExamine(EntityUid uid, LabelComponent? label, ExaminedEvent args)
{
if (!Resolve(uid, ref label))
return;
if (label.CurrentLabel == null)
return;
var message = new FormattedMessage();
message.AddText(Loc.GetString("hand-labeler-has-label", ("label", label.CurrentLabel)));
args.PushMessage(message);
}
}