mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
Random Announcer System (#415)
# Description Replaces every instance of station announcements with an announcer system meant to handle audio and messages for various announcers defined in prototypes instead of each server replacing the scattered files inconsistently with whatever singular thing they want to hear announce messages. # TODO - [x] Systems - [x] CVars - [x] Sounds - [x] Client volume slider - [x] Collections - [x] Prototypes - [x] Events - [x] Commands - [x] PR media - [x] Deglobalize - [x] Passthrough localization parameters to overrides - [x] Make every announcer follow the template - [x] Move sounds into subdirectories - [x] Make announcement IDs camelCased - [x] Test announcement localizations - [x] Weighted announcer lists --- <details><summary><h1>Media</h1></summary> <p> https://github.com/Simple-Station/Parkstation-Friendly-Chainsaw/assets/77995199/caf5805d-acb0-4140-b344-875a8f79e5ee </p> </details> --- # Changelog 🆑 - add: Added 4 new announcers that will randomly be selected every shift
This commit is contained in:
@@ -7,6 +7,8 @@ using Content.Server.Station.Systems;
|
||||
using Content.Shared.Paper;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Utility;
|
||||
using Content.Server.Announcements.Systems;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Server.Nuke
|
||||
{
|
||||
@@ -17,6 +19,7 @@ namespace Content.Server.Nuke
|
||||
[Dependency] private readonly StationSystem _station = default!;
|
||||
[Dependency] private readonly PaperSystem _paper = default!;
|
||||
[Dependency] private readonly FaxSystem _faxSystem = default!;
|
||||
[Dependency] private readonly AnnouncerSystem _announcer = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -57,9 +60,7 @@ namespace Content.Server.Nuke
|
||||
while (faxes.MoveNext(out var faxEnt, out var fax))
|
||||
{
|
||||
if (!fax.ReceiveNukeCodes || !TryGetRelativeNukeCode(faxEnt, out var paperContent, station))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var printout = new FaxPrintout(
|
||||
paperContent,
|
||||
@@ -77,10 +78,8 @@ namespace Content.Server.Nuke
|
||||
}
|
||||
|
||||
if (wasSent)
|
||||
{
|
||||
var msg = Loc.GetString("nuke-component-announcement-send-codes");
|
||||
_chatSystem.DispatchStationAnnouncement(station, msg, colorOverride: Color.Red);
|
||||
}
|
||||
_announcer.SendAnnouncement(_announcer.GetAnnouncementId("NukeCodes"), Filter.Broadcast(),
|
||||
"nuke-component-announcement-send-codes", colorOverride: Color.Red);
|
||||
|
||||
return wasSent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user