Communications Console: The ECSining (#8374)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Server.Chat;
|
||||
using Content.Server.Communications;
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Shared.GameTicking;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
@@ -12,7 +13,8 @@ namespace Content.Server.Nuke
|
||||
public sealed class NukeCodeSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly IChatManager _chat = default!;
|
||||
[Dependency] private readonly ChatSystem _chatSystem = default!;
|
||||
[Dependency] private readonly StationSystem _stationSystem = default!;
|
||||
|
||||
private const int CodeLength = 6;
|
||||
public string Code { get; private set; } = default!;
|
||||
@@ -73,10 +75,11 @@ namespace Content.Server.Nuke
|
||||
wasSent = true;
|
||||
}
|
||||
|
||||
// TODO: Allow selecting a station for nuke codes
|
||||
if (wasSent)
|
||||
{
|
||||
var msg = Loc.GetString("nuke-component-announcement-send-codes");
|
||||
_chat.DispatchStationAnnouncement(msg, colorOverride: Color.Red);
|
||||
_chatSystem.DispatchGlobalStationAnnouncement(msg, colorOverride: Color.Red);
|
||||
}
|
||||
|
||||
return wasSent;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Server.AlertLevel;
|
||||
using Content.Server.Chat;
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Server.Coordinates.Helpers;
|
||||
using Content.Server.Explosion.EntitySystems;
|
||||
@@ -24,7 +25,7 @@ namespace Content.Server.Nuke
|
||||
[Dependency] private readonly ExplosionSystem _explosions = default!;
|
||||
[Dependency] private readonly AlertLevelSystem _alertLevel = default!;
|
||||
[Dependency] private readonly StationSystem _stationSystem = default!;
|
||||
[Dependency] private readonly IChatManager _chat = default!;
|
||||
[Dependency] private readonly ChatSystem _chatSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -340,7 +341,7 @@ namespace Content.Server.Nuke
|
||||
var announcement = Loc.GetString("nuke-component-announcement-armed",
|
||||
("time", (int) component.RemainingTime));
|
||||
var sender = Loc.GetString("nuke-component-announcement-sender");
|
||||
_chat.DispatchStationAnnouncement(announcement, sender, false, Color.Red);
|
||||
_chatSystem.DispatchStationAnnouncement(uid, announcement, sender, false, Color.Red);
|
||||
|
||||
// todo: move it to announcements system
|
||||
SoundSystem.Play(Filter.Broadcast(), component.ArmSound.GetSound());
|
||||
@@ -369,7 +370,7 @@ namespace Content.Server.Nuke
|
||||
// warn a crew
|
||||
var announcement = Loc.GetString("nuke-component-announcement-unarmed");
|
||||
var sender = Loc.GetString("nuke-component-announcement-sender");
|
||||
_chat.DispatchStationAnnouncement(announcement, sender, false);
|
||||
_chatSystem.DispatchStationAnnouncement(uid, announcement, sender, false);
|
||||
|
||||
// todo: move it to announcements system
|
||||
SoundSystem.Play(Filter.Broadcast(), component.DisarmSound.GetSound());
|
||||
|
||||
Reference in New Issue
Block a user