De-hardcode shuttle docking messages/audio (#37813)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Content.Server.Shuttles.Systems;
|
using Content.Server.Shuttles.Systems;
|
||||||
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations;
|
using Robust.Shared.Serialization.TypeSerializers.Implementations;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
@@ -21,4 +22,39 @@ public sealed partial class StationEmergencyShuttleComponent : Component
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("emergencyShuttlePath", customTypeSerializer: typeof(ResPathSerializer))]
|
[DataField("emergencyShuttlePath", customTypeSerializer: typeof(ResPathSerializer))]
|
||||||
public ResPath EmergencyShuttlePath { get; set; } = new("/Maps/Shuttles/emergency.yml");
|
public ResPath EmergencyShuttlePath { get; set; } = new("/Maps/Shuttles/emergency.yml");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The announcement made when the shuttle has successfully docked with the station.
|
||||||
|
/// </summary>
|
||||||
|
public LocId DockedAnnouncement = "emergency-shuttle-docked";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sound played when the shuttle has successfully docked with the station.
|
||||||
|
/// </summary>
|
||||||
|
public SoundSpecifier DockedAudio = new SoundPathSpecifier("/Audio/Announcements/shuttle_dock.ogg");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The announcement made when the shuttle is unable to dock and instead parks in nearby space.
|
||||||
|
/// </summary>
|
||||||
|
public LocId NearbyAnnouncement = "emergency-shuttle-nearby";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sound played when the shuttle is unable to dock and instead parks in nearby space.
|
||||||
|
/// </summary>
|
||||||
|
public SoundSpecifier NearbyAudio = new SoundPathSpecifier("/Audio/Misc/notice1.ogg");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The announcement made when the shuttle is unable to find a station.
|
||||||
|
/// </summary>
|
||||||
|
public LocId FailureAnnouncement = "emergency-shuttle-good-luck";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sound played when the shuttle is unable to find a station.
|
||||||
|
/// </summary>
|
||||||
|
public SoundSpecifier FailureAudio = new SoundPathSpecifier("/Audio/Misc/notice1.ogg");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Text appended to the docking announcement if the launch time has been extended.
|
||||||
|
/// </summary>
|
||||||
|
public LocId LaunchExtendedMessage = "emergency-shuttle-extended";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -323,6 +323,7 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void AnnounceShuttleDock(ShuttleDockResult result, bool extended)
|
public void AnnounceShuttleDock(ShuttleDockResult result, bool extended)
|
||||||
{
|
{
|
||||||
|
var stationShuttleComp = result.Station.Comp;
|
||||||
var shuttle = result.Station.Comp.EmergencyShuttle;
|
var shuttle = result.Station.Comp.EmergencyShuttle;
|
||||||
|
|
||||||
DebugTools.Assert(shuttle != null);
|
DebugTools.Assert(shuttle != null);
|
||||||
@@ -331,11 +332,11 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
_chatSystem.DispatchStationAnnouncement(
|
_chatSystem.DispatchStationAnnouncement(
|
||||||
result.Station,
|
result.Station,
|
||||||
Loc.GetString("emergency-shuttle-good-luck"),
|
Loc.GetString(stationShuttleComp.FailureAnnouncement),
|
||||||
playDefaultSound: false);
|
playDefaultSound: false);
|
||||||
|
|
||||||
// TODO: Need filter extensions or something don't blame me.
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,10 +355,10 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
|
|||||||
var location = FormattedMessage.RemoveMarkupPermissive(
|
var location = FormattedMessage.RemoveMarkupPermissive(
|
||||||
_navMap.GetNearestBeaconString((shuttle.Value, Transform(shuttle.Value))));
|
_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
|
var locKey = result.ResultType == ShuttleDockResultType.NoDock
|
||||||
? "emergency-shuttle-nearby"
|
? stationShuttleComp.NearbyAnnouncement
|
||||||
: "emergency-shuttle-docked";
|
: stationShuttleComp.DockedAnnouncement;
|
||||||
|
|
||||||
_chatSystem.DispatchStationAnnouncement(
|
_chatSystem.DispatchStationAnnouncement(
|
||||||
result.Station,
|
result.Station,
|
||||||
@@ -390,8 +391,8 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
|
|||||||
// Play announcement audio.
|
// Play announcement audio.
|
||||||
|
|
||||||
var audioFile = result.ResultType == ShuttleDockResultType.NoDock
|
var audioFile = result.ResultType == ShuttleDockResultType.NoDock
|
||||||
? "/Audio/Misc/notice1.ogg"
|
? stationShuttleComp.NearbyAudio
|
||||||
: "/Audio/Announcements/shuttle_dock.ogg";
|
: stationShuttleComp.DockedAudio;
|
||||||
|
|
||||||
// TODO: Need filter extensions or something don't blame me.
|
// TODO: Need filter extensions or something don't blame me.
|
||||||
_audio.PlayGlobal(audioFile, Filter.Broadcast(), true);
|
_audio.PlayGlobal(audioFile, Filter.Broadcast(), true);
|
||||||
|
|||||||
Reference in New Issue
Block a user