Nuke ops war anounce sound (#9035)
This commit is contained in:
@@ -16,6 +16,7 @@ using Content.Shared.Chat;
|
|||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
using Content.Shared.Inventory;
|
using Content.Shared.Inventory;
|
||||||
|
using Content.Shared.Sound;
|
||||||
using Robust.Server.Player;
|
using Robust.Server.Player;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
@@ -51,7 +52,7 @@ public sealed partial class ChatSystem : SharedChatSystem
|
|||||||
|
|
||||||
private const int VoiceRange = 7; // how far voice goes in world units
|
private const int VoiceRange = 7; // how far voice goes in world units
|
||||||
private const int WhisperRange = 2; // how far whisper goes in world units
|
private const int WhisperRange = 2; // how far whisper goes in world units
|
||||||
private const string AnnouncementSound = "/Audio/Announcements/announce.ogg";
|
private const string DefaultAnnouncementSound = "/Audio/Announcements/announce.ogg";
|
||||||
|
|
||||||
private bool _loocEnabled = true;
|
private bool _loocEnabled = true;
|
||||||
private readonly bool _adminLoocEnabled = true;
|
private readonly bool _adminLoocEnabled = true;
|
||||||
@@ -170,16 +171,16 @@ public sealed partial class ChatSystem : SharedChatSystem
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">The contents of the message</param>
|
/// <param name="message">The contents of the message</param>
|
||||||
/// <param name="sender">The sender (Communications Console in Communications Console Announcement)</param>
|
/// <param name="sender">The sender (Communications Console in Communications Console Announcement)</param>
|
||||||
/// <param name="playDefaultSound">Play the announcement sound</param>
|
/// <param name="playSound">Play the announcement sound</param>
|
||||||
/// <param name="colorOverride">Optional color for the announcement message</param>
|
/// <param name="colorOverride">Optional color for the announcement message</param>
|
||||||
public void DispatchGlobalAnnouncement(string message, string sender = "Central Command",
|
public void DispatchGlobalAnnouncement(string message, string sender = "Central Command",
|
||||||
bool playDefaultSound = true, Color? colorOverride = null)
|
bool playSound = true, SoundSpecifier? announcementSound = null, Color? colorOverride = null)
|
||||||
{
|
{
|
||||||
var messageWrap = Loc.GetString("chat-manager-sender-announcement-wrap-message", ("sender", sender));
|
var messageWrap = Loc.GetString("chat-manager-sender-announcement-wrap-message", ("sender", sender));
|
||||||
_chatManager.ChatMessageToAll(ChatChannel.Radio, message, messageWrap, colorOverride);
|
_chatManager.ChatMessageToAll(ChatChannel.Radio, message, messageWrap, colorOverride);
|
||||||
if (playDefaultSound)
|
if (playSound)
|
||||||
{
|
{
|
||||||
SoundSystem.Play(AnnouncementSound, Filter.Broadcast(), AudioParams.Default.WithVolume(-2f));
|
SoundSystem.Play(announcementSound?.GetSound() ?? DefaultAnnouncementSound, Filter.Broadcast(), AudioParams.Default.WithVolume(-2f));
|
||||||
}
|
}
|
||||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Global station announcement from {sender}: {message}");
|
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Global station announcement from {sender}: {message}");
|
||||||
}
|
}
|
||||||
@@ -192,7 +193,8 @@ public sealed partial class ChatSystem : SharedChatSystem
|
|||||||
/// <param name="sender">The sender (Communications Console in Communications Console Announcement)</param>
|
/// <param name="sender">The sender (Communications Console in Communications Console Announcement)</param>
|
||||||
/// <param name="playDefaultSound">Play the announcement sound</param>
|
/// <param name="playDefaultSound">Play the announcement sound</param>
|
||||||
/// <param name="colorOverride">Optional color for the announcement message</param>
|
/// <param name="colorOverride">Optional color for the announcement message</param>
|
||||||
public void DispatchStationAnnouncement(EntityUid source, string message, string sender = "Central Command", bool playDefaultSound = true, Color? colorOverride = null)
|
public void DispatchStationAnnouncement(EntityUid source, string message, string sender = "Central Command",
|
||||||
|
bool playDefaultSound = true, SoundSpecifier? announcementSound = null, Color? colorOverride = null)
|
||||||
{
|
{
|
||||||
var messageWrap = Loc.GetString("chat-manager-sender-announcement-wrap-message", ("sender", sender));
|
var messageWrap = Loc.GetString("chat-manager-sender-announcement-wrap-message", ("sender", sender));
|
||||||
var station = _stationSystem.GetOwningStation(source);
|
var station = _stationSystem.GetOwningStation(source);
|
||||||
@@ -211,7 +213,7 @@ public sealed partial class ChatSystem : SharedChatSystem
|
|||||||
|
|
||||||
if (playDefaultSound)
|
if (playDefaultSound)
|
||||||
{
|
{
|
||||||
SoundSystem.Play(AnnouncementSound, filter, AudioParams.Default.WithVolume(-2f));
|
SoundSystem.Play(announcementSound?.GetSound() ?? DefaultAnnouncementSound, filter, AudioParams.Default.WithVolume(-2f));
|
||||||
}
|
}
|
||||||
|
|
||||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Station Announcement on {station} from {sender}: {message}");
|
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Station Announcement on {station} from {sender}: {message}");
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Content.Server.UserInterface;
|
using Content.Server.UserInterface;
|
||||||
using Content.Shared.Communications;
|
using Content.Shared.Communications;
|
||||||
|
using Content.Shared.Sound;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
|
|
||||||
namespace Content.Server.Communications
|
namespace Content.Server.Communications
|
||||||
@@ -50,6 +51,12 @@ namespace Content.Server.Communications
|
|||||||
[DataField("global")]
|
[DataField("global")]
|
||||||
public bool AnnounceGlobal = false;
|
public bool AnnounceGlobal = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Announce sound file path
|
||||||
|
/// </summary>
|
||||||
|
[DataField("sound")]
|
||||||
|
public SoundSpecifier AnnouncementSound = new SoundPathSpecifier("/Audio/Announcements/announce.ogg");
|
||||||
|
|
||||||
public BoundUserInterface? UserInterface => Owner.GetUIOrNull(CommunicationsConsoleUiKey.Key);
|
public BoundUserInterface? UserInterface => Owner.GetUIOrNull(CommunicationsConsoleUiKey.Key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ namespace Content.Server.Communications
|
|||||||
msg += "\n" + Loc.GetString("comms-console-announcement-sent-by") + " " + author;
|
msg += "\n" + Loc.GetString("comms-console-announcement-sent-by") + " " + author;
|
||||||
if (comp.AnnounceGlobal)
|
if (comp.AnnounceGlobal)
|
||||||
{
|
{
|
||||||
_chatSystem.DispatchGlobalAnnouncement(msg, title, colorOverride: comp.AnnouncementColor);
|
_chatSystem.DispatchGlobalAnnouncement(msg, title, announcementSound: comp.AnnouncementSound, colorOverride: comp.AnnouncementColor);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_chatSystem.DispatchStationAnnouncement(uid, msg, title, colorOverride: comp.AnnouncementColor);
|
_chatSystem.DispatchStationAnnouncement(uid, msg, title, colorOverride: comp.AnnouncementColor);
|
||||||
|
|||||||
@@ -484,7 +484,7 @@ namespace Content.Server.GameTicking
|
|||||||
if (!proto.GamePresets.Contains(Preset.ID)) continue;
|
if (!proto.GamePresets.Contains(Preset.ID)) continue;
|
||||||
|
|
||||||
if (proto.Message != null)
|
if (proto.Message != null)
|
||||||
_chatSystem.DispatchGlobalAnnouncement(Loc.GetString(proto.Message), playDefaultSound: true);
|
_chatSystem.DispatchGlobalAnnouncement(Loc.GetString(proto.Message), playSound: true);
|
||||||
|
|
||||||
if (proto.Sound != null)
|
if (proto.Sound != null)
|
||||||
SoundSystem.Play(proto.Sound.GetSound(), Filter.Broadcast());
|
SoundSystem.Play(proto.Sound.GetSound(), Filter.Broadcast());
|
||||||
|
|||||||
@@ -432,7 +432,7 @@ namespace Content.Server.Nuke
|
|||||||
var announcement = Loc.GetString("nuke-component-announcement-armed",
|
var announcement = Loc.GetString("nuke-component-announcement-armed",
|
||||||
("time", (int) component.RemainingTime), ("position", posText));
|
("time", (int) component.RemainingTime), ("position", posText));
|
||||||
var sender = Loc.GetString("nuke-component-announcement-sender");
|
var sender = Loc.GetString("nuke-component-announcement-sender");
|
||||||
_chatSystem.DispatchStationAnnouncement(uid, announcement, sender, false, Color.Red);
|
_chatSystem.DispatchStationAnnouncement(uid, announcement, sender, false, null, Color.Red);
|
||||||
|
|
||||||
NukeArmedAudio(component);
|
NukeArmedAudio(component);
|
||||||
|
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ namespace Content.Server.RoundEnd
|
|||||||
("units", Loc.GetString(units))),
|
("units", Loc.GetString(units))),
|
||||||
Loc.GetString("Station"),
|
Loc.GetString("Station"),
|
||||||
false,
|
false,
|
||||||
|
null,
|
||||||
Color.Gold);
|
Color.Gold);
|
||||||
|
|
||||||
SoundSystem.Play("/Audio/Announcements/shuttlecalled.ogg", Filter.Broadcast());
|
SoundSystem.Play("/Audio/Announcements/shuttlecalled.ogg", Filter.Broadcast());
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ public sealed partial class ShuttleSystem
|
|||||||
if (remaining > 0)
|
if (remaining > 0)
|
||||||
_chatSystem.DispatchGlobalAnnouncement(
|
_chatSystem.DispatchGlobalAnnouncement(
|
||||||
Loc.GetString("emergency-shuttle-console-auth-left", ("remaining", remaining)),
|
Loc.GetString("emergency-shuttle-console-auth-left", ("remaining", remaining)),
|
||||||
playDefaultSound: false, colorOverride: DangerColor);
|
playSound: false, colorOverride: DangerColor);
|
||||||
|
|
||||||
if (!CheckForLaunch(component))
|
if (!CheckForLaunch(component))
|
||||||
SoundSystem.Play("/Audio/Misc/notice1.ogg", Filter.Broadcast());
|
SoundSystem.Play("/Audio/Misc/notice1.ogg", Filter.Broadcast());
|
||||||
@@ -297,7 +297,7 @@ public sealed partial class ShuttleSystem
|
|||||||
_announced = true;
|
_announced = true;
|
||||||
_chatSystem.DispatchGlobalAnnouncement(
|
_chatSystem.DispatchGlobalAnnouncement(
|
||||||
Loc.GetString("emergency-shuttle-launch-time", ("consoleAccumulator", $"{_consoleAccumulator:0}")),
|
Loc.GetString("emergency-shuttle-launch-time", ("consoleAccumulator", $"{_consoleAccumulator:0}")),
|
||||||
playDefaultSound: false,
|
playSound: false,
|
||||||
colorOverride: DangerColor);
|
colorOverride: DangerColor);
|
||||||
|
|
||||||
SoundSystem.Play("/Audio/Misc/notice1.ogg", Filter.Broadcast());
|
SoundSystem.Play("/Audio/Misc/notice1.ogg", Filter.Broadcast());
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public sealed class BreakerFlip : StationEventSystem
|
|||||||
base.Added();
|
base.Added();
|
||||||
|
|
||||||
var str = Loc.GetString("station-event-breaker-flip-announcement", ("data", Loc.GetString(Loc.GetString($"random-sentience-event-data-{RobustRandom.Next(1, 6)}"))));
|
var str = Loc.GetString("station-event-breaker-flip-announcement", ("data", Loc.GetString(Loc.GetString($"random-sentience-event-data-{RobustRandom.Next(1, 6)}"))));
|
||||||
ChatSystem.DispatchGlobalAnnouncement(str, playDefaultSound: false, colorOverride: Color.Gold);
|
ChatSystem.DispatchGlobalAnnouncement(str, playSound: false, colorOverride: Color.Gold);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Started()
|
public override void Started()
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace Content.Server.StationEvents.Events
|
|||||||
|
|
||||||
if (cfg.StartAnnouncement != null)
|
if (cfg.StartAnnouncement != null)
|
||||||
{
|
{
|
||||||
ChatSystem.DispatchGlobalAnnouncement(Loc.GetString(cfg.StartAnnouncement), playDefaultSound: false, colorOverride: Color.Gold);
|
ChatSystem.DispatchGlobalAnnouncement(Loc.GetString(cfg.StartAnnouncement), playSound: false, colorOverride: Color.Gold);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg.StartAudio != null)
|
if (cfg.StartAudio != null)
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace Content.Server.StationEvents.Events
|
|||||||
|
|
||||||
if (ev.StartAnnouncement != null)
|
if (ev.StartAnnouncement != null)
|
||||||
{
|
{
|
||||||
ChatSystem.DispatchGlobalAnnouncement(Loc.GetString(ev.StartAnnouncement), playDefaultSound: false, colorOverride: Color.Gold);
|
ChatSystem.DispatchGlobalAnnouncement(Loc.GetString(ev.StartAnnouncement), playSound: false, colorOverride: Color.Gold);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev.StartAudio != null)
|
if (ev.StartAudio != null)
|
||||||
@@ -85,7 +85,7 @@ namespace Content.Server.StationEvents.Events
|
|||||||
|
|
||||||
if (ev.EndAnnouncement != null)
|
if (ev.EndAnnouncement != null)
|
||||||
{
|
{
|
||||||
ChatSystem.DispatchGlobalAnnouncement(Loc.GetString(ev.EndAnnouncement), playDefaultSound: false, colorOverride: Color.Gold);
|
ChatSystem.DispatchGlobalAnnouncement(Loc.GetString(ev.EndAnnouncement), playSound: false, colorOverride: Color.Gold);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev.EndAudio != null)
|
if (ev.EndAudio != null)
|
||||||
|
|||||||
@@ -5,4 +5,5 @@ outbreak7.ogg taken from /tg/station at commit https://github.com/tgstation/tgst
|
|||||||
welcome.ogg taken from /tg/station at commit https://github.com/tgstation/tgstation/commit/40d89d11ea4a5cb81d61dc1018b46f4e7d32c62a used under CC-BY-SA-3.0
|
welcome.ogg taken from /tg/station at commit https://github.com/tgstation/tgstation/commit/40d89d11ea4a5cb81d61dc1018b46f4e7d32c62a used under CC-BY-SA-3.0
|
||||||
announce.ogg taken from /tg/station https://github.com/tgstation/tgstation/commit/40d89d11ea4a5cb81d61dc1018b46f4e7d32c62a cut from the beginning of "shuttlerecalled.ogg" used under CC-BY-SA-3.0
|
announce.ogg taken from /tg/station https://github.com/tgstation/tgstation/commit/40d89d11ea4a5cb81d61dc1018b46f4e7d32c62a cut from the beginning of "shuttlerecalled.ogg" used under CC-BY-SA-3.0
|
||||||
|
|
||||||
shuttle_dock.ogg taken from /tg/station at https://github.com/tgstation/tgstation/blob/b327cb667c1ca5d1aa14e6368e66cbfa7b343b9c/sound/ai/default/shuttledock.ogg used under CC-BY-SA-3.0
|
shuttle_dock.ogg taken from /tg/station at https://github.com/tgstation/tgstation/blob/b327cb667c1ca5d1aa14e6368e66cbfa7b343b9c/sound/ai/default/shuttledock.ogg used under CC-BY-SA-3.0
|
||||||
|
war.ogg taken from Paradise at https://github.com/ParadiseSS13/Paradise/blob/07b26ee6b4a11a0607986d322ee007020569feae/sound/effects/siren.ogg used under CC-BY-SA-3.0, volume increased
|
||||||
|
|||||||
BIN
Resources/Audio/Announcements/war.ogg
Normal file
BIN
Resources/Audio/Announcements/war.ogg
Normal file
Binary file not shown.
@@ -371,6 +371,7 @@
|
|||||||
color: "#ff0000"
|
color: "#ff0000"
|
||||||
canShuttle: false
|
canShuttle: false
|
||||||
global: true #announce to everyone they're about to fuck shit up
|
global: true #announce to everyone they're about to fuck shit up
|
||||||
|
sound: /Audio/Announcements/war.ogg
|
||||||
- type: Computer
|
- type: Computer
|
||||||
board: SyndicateCommsComputerCircuitboard
|
board: SyndicateCommsComputerCircuitboard
|
||||||
- type: PointLight
|
- type: PointLight
|
||||||
|
|||||||
Reference in New Issue
Block a user