Files
ss14-wl/Content.Server/Nuke/NukeLabelSystem.cs
Pieter-Jan BriersandGitHub 5168b5f3d4 IoC source gen compatibility (#43863)
* IoC source gen compatibility

Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter.

* Missed a spot
2026-05-09 03:29:58 +00:00

24 lines
777 B
C#

namespace Content.Server.Nuke;
/// <summary>
/// This handles labelling an entity with a nuclear bomb label.
/// </summary>
public sealed partial class NukeLabelSystem : EntitySystem
{
[Dependency] private NukeSystem _nuke = default!;
[Dependency] private MetaDataSystem _metaData = default!;
/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<NukeLabelComponent, MapInitEvent>(OnMapInit);
}
private void OnMapInit(EntityUid uid, NukeLabelComponent nuke, MapInitEvent args)
{
var label = Loc.GetString(nuke.Prefix, ("serial", _nuke.GenerateRandomNumberString(nuke.SerialLength)));
var meta = MetaData(uid);
_metaData.SetEntityName(uid, $"{meta.EntityName} ({label})", meta);
}
}