From: Tayrtahn Date: Sun, 25 May 2025 15:46:52 +0000 (-0400) Subject: De-hardcode shuttle docking messages/audio (#37813) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=4c4c98617e1407289e89e00036d5052327b483fe;p=space-station-14.git De-hardcode shuttle docking messages/audio (#37813) --- diff --git a/Content.Server/Shuttles/Components/StationEmergencyShuttleComponent.cs b/Content.Server/Shuttles/Components/StationEmergencyShuttleComponent.cs index 58d23ee432..d4fcfb81c6 100644 --- a/Content.Server/Shuttles/Components/StationEmergencyShuttleComponent.cs +++ b/Content.Server/Shuttles/Components/StationEmergencyShuttleComponent.cs @@ -1,4 +1,5 @@ using Content.Server.Shuttles.Systems; +using Robust.Shared.Audio; using Robust.Shared.Serialization.TypeSerializers.Implementations; using Robust.Shared.Utility; @@ -21,4 +22,39 @@ public sealed partial class StationEmergencyShuttleComponent : Component /// [DataField("emergencyShuttlePath", customTypeSerializer: typeof(ResPathSerializer))] public ResPath EmergencyShuttlePath { get; set; } = new("/Maps/Shuttles/emergency.yml"); + + /// + /// The announcement made when the shuttle has successfully docked with the station. + /// + public LocId DockedAnnouncement = "emergency-shuttle-docked"; + + /// + /// Sound played when the shuttle has successfully docked with the station. + /// + public SoundSpecifier DockedAudio = new SoundPathSpecifier("/Audio/Announcements/shuttle_dock.ogg"); + + /// + /// The announcement made when the shuttle is unable to dock and instead parks in nearby space. + /// + public LocId NearbyAnnouncement = "emergency-shuttle-nearby"; + + /// + /// Sound played when the shuttle is unable to dock and instead parks in nearby space. + /// + public SoundSpecifier NearbyAudio = new SoundPathSpecifier("/Audio/Misc/notice1.ogg"); + + /// + /// The announcement made when the shuttle is unable to find a station. + /// + public LocId FailureAnnouncement = "emergency-shuttle-good-luck"; + + /// + /// Sound played when the shuttle is unable to find a station. + /// + public SoundSpecifier FailureAudio = new SoundPathSpecifier("/Audio/Misc/notice1.ogg"); + + /// + /// Text appended to the docking announcement if the launch time has been extended. + /// + public LocId LaunchExtendedMessage = "emergency-shuttle-extended"; } diff --git a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs index c9c764a014..94e028b402 100644 --- a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs +++ b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs @@ -323,6 +323,7 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem /// public void AnnounceShuttleDock(ShuttleDockResult result, bool extended) { + var stationShuttleComp = result.Station.Comp; var shuttle = result.Station.Comp.EmergencyShuttle; DebugTools.Assert(shuttle != null); @@ -331,11 +332,11 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem { _chatSystem.DispatchStationAnnouncement( result.Station, - Loc.GetString("emergency-shuttle-good-luck"), + Loc.GetString(stationShuttleComp.FailureAnnouncement), playDefaultSound: false); // TODO: Need filter extensions or something don't blame me. - _audio.PlayGlobal("/Audio/Misc/notice1.ogg", Filter.Broadcast(), true); + _audio.PlayGlobal(stationShuttleComp.FailureAudio, Filter.Broadcast(), true); return; } @@ -354,10 +355,10 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem var location = FormattedMessage.RemoveMarkupPermissive( _navMap.GetNearestBeaconString((shuttle.Value, Transform(shuttle.Value)))); - var extendedText = extended ? Loc.GetString("emergency-shuttle-extended") : ""; + var extendedText = extended ? Loc.GetString(stationShuttleComp.LaunchExtendedMessage) : ""; var locKey = result.ResultType == ShuttleDockResultType.NoDock - ? "emergency-shuttle-nearby" - : "emergency-shuttle-docked"; + ? stationShuttleComp.NearbyAnnouncement + : stationShuttleComp.DockedAnnouncement; _chatSystem.DispatchStationAnnouncement( result.Station, @@ -390,8 +391,8 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem // Play announcement audio. var audioFile = result.ResultType == ShuttleDockResultType.NoDock - ? "/Audio/Misc/notice1.ogg" - : "/Audio/Announcements/shuttle_dock.ogg"; + ? stationShuttleComp.NearbyAudio + : stationShuttleComp.DockedAudio; // TODO: Need filter extensions or something don't blame me. _audio.PlayGlobal(audioFile, Filter.Broadcast(), true);