mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
24 lines
780 B
C#
24 lines
780 B
C#
using Content.Server.Announcements.Systems;
|
|
using Robust.Shared.Player;
|
|
|
|
namespace Content.Server.Chat.Systems;
|
|
|
|
public sealed class AnnounceOnSpawnSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly AnnouncerSystem _announcer = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<AnnounceOnSpawnComponent, MapInitEvent>(OnInit);
|
|
}
|
|
|
|
private void OnInit(EntityUid uid, AnnounceOnSpawnComponent comp, MapInitEvent args)
|
|
{
|
|
var sender = comp.Sender != null ? Loc.GetString(comp.Sender) : Loc.GetString("chat-manager-sender-announcement");
|
|
_announcer.SendAnnouncement(_announcer.GetAnnouncementId("SpawnAnnounceCaptain"),
|
|
comp.Message, sender, colorOverride: comp.Color);
|
|
}
|
|
}
|