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:
Veritius
2022-06-03 21:37:35 +10:00
committed by GitHub
parent c6d20e6ccf
commit 237cb3d0b4
33 changed files with 608 additions and 249 deletions

View File

@@ -1,9 +1,6 @@
using System.Linq;
using Content.Server.Administration.Logs;
using Content.Server.Chat.Managers;
using Content.Server.Station.Components;
using Content.Server.Chat;
using Content.Server.Station.Systems;
using Content.Shared.AlertLevel;
using Robust.Shared.Audio;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
@@ -13,7 +10,7 @@ namespace Content.Server.AlertLevel;
public sealed class AlertLevelSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IChatManager _chatManager = default!;
[Dependency] private readonly ChatSystem _chatSystem = default!;
[Dependency] private readonly StationSystem _stationSystem = default!;
// Until stations are a prototype, this is how it's going to have to be.
@@ -52,7 +49,7 @@ public sealed class AlertLevelSystem : EntitySystem
continue;
}
alert.CurrentDelay--;
alert.CurrentDelay -= time;
}
}
@@ -186,11 +183,11 @@ public sealed class AlertLevelSystem : EntitySystem
if (announce)
{
_chatManager.DispatchStationAnnouncement(announcementFull, playDefaultSound: playDefault,
_chatSystem.DispatchStationAnnouncement(station, announcementFull, playDefaultSound: playDefault,
colorOverride: detail.Color, sender: stationName);
}
RaiseLocalEvent(new AlertLevelChangedEvent(level));
RaiseLocalEvent(new AlertLevelChangedEvent(station, level));
}
}
@@ -202,10 +199,12 @@ public sealed class AlertLevelPrototypeReloadedEvent : EntityEventArgs
public sealed class AlertLevelChangedEvent : EntityEventArgs
{
public EntityUid Station { get; }
public string AlertLevel { get; }
public AlertLevelChangedEvent(string alertLevel)
public AlertLevelChangedEvent(EntityUid station, string alertLevel)
{
Station = station;
AlertLevel = alertLevel;
}
}