From d6aa3888c7f64dbff22fb0e4d7fe21f533966022 Mon Sep 17 00:00:00 2001 From: DEATHB4DEFEAT Date: Sat, 17 Feb 2024 15:54:45 -0800 Subject: [PATCH] rename announcementPaths to announcements --- .../Announcers/AnnouncerFallbackTest.cs | 4 ++-- .../Systems/AnnouncerSystem.Announce.cs | 4 ++-- .../Prototypes/AnnouncerPrototype.cs | 4 ++-- .../Systems/SharedAnnouncerSystem.cs | 20 +++++++++---------- .../SimpleStation14/Announcers/intern.yml | 2 +- .../SimpleStation14/Announcers/medbot.yml | 2 +- .../SimpleStation14/Announcers/neil.yml | 2 +- .../SimpleStation14/Announcers/template | 2 +- .../SimpleStation14/Announcers/voxfem.yml | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Content.IntegrationTests/Tests/SimpleStation14/Announcers/AnnouncerFallbackTest.cs b/Content.IntegrationTests/Tests/SimpleStation14/Announcers/AnnouncerFallbackTest.cs index 3802639873..187211212b 100644 --- a/Content.IntegrationTests/Tests/SimpleStation14/Announcers/AnnouncerFallbackTest.cs +++ b/Content.IntegrationTests/Tests/SimpleStation14/Announcers/AnnouncerFallbackTest.cs @@ -6,7 +6,7 @@ namespace Content.IntegrationTests.Tests.SimpleStation14.Announcers; [TestFixture] [TestOf(typeof(AnnouncerPrototype))] -public sealed class AnnouncerPrototypeTest +public sealed partial class AnnouncerPrototypeTests { [Test] public async Task TestAnnouncerFallbacks() @@ -20,7 +20,7 @@ await server.WaitAssertion(() => { foreach (var announcer in prototype.EnumeratePrototypes()) { - Assert.That(announcer.AnnouncementPaths.Any(a => a.ID.ToLower() == "fallback"), + Assert.That(announcer.Announcements.Any(a => a.ID.ToLower() == "fallback"), Is.True, $"Announcer \"{announcer.ID}\" does not have a fallback announcement"); } diff --git a/Content.Server/SimpleStation14/Announcements/Systems/AnnouncerSystem.Announce.cs b/Content.Server/SimpleStation14/Announcements/Systems/AnnouncerSystem.Announce.cs index 51dd4c3c24..1109da285a 100644 --- a/Content.Server/SimpleStation14/Announcements/Systems/AnnouncerSystem.Announce.cs +++ b/Content.Server/SimpleStation14/Announcements/Systems/AnnouncerSystem.Announce.cs @@ -15,8 +15,8 @@ public sealed partial class AnnouncerSystem { // Get the announcement data from the announcer // Will be the fallback if the data for the announcementId is not found - var announcementType = Announcer.AnnouncementPaths.FirstOrDefault(a => a.ID == announcementId) ?? - Announcer.AnnouncementPaths.First(a => a.ID == "fallback"); + var announcementType = Announcer.Announcements.FirstOrDefault(a => a.ID == announcementId) ?? + Announcer.Announcements.First(a => a.ID == "fallback"); // Return the announcementType.MessageOverride if it exists, otherwise return null return announcementType.MessageOverride != null ? Loc.GetString(announcementType.MessageOverride) : null; diff --git a/Content.Shared/SimpleStation14/Announcements/Prototypes/AnnouncerPrototype.cs b/Content.Shared/SimpleStation14/Announcements/Prototypes/AnnouncerPrototype.cs index 0d4ac39753..f5a6cec5d6 100644 --- a/Content.Shared/SimpleStation14/Announcements/Prototypes/AnnouncerPrototype.cs +++ b/Content.Shared/SimpleStation14/Announcements/Prototypes/AnnouncerPrototype.cs @@ -25,8 +25,8 @@ public sealed class AnnouncerPrototype : IPrototype [DataField("baseAudioParams")] public AudioParams? BaseAudioParams { get; } - [DataField("announcementPaths")] - public AnnouncementData[] AnnouncementPaths { get; } = default!; + [DataField("announcements")] + public AnnouncementData[] Announcements { get; } = default!; } /// diff --git a/Content.Shared/SimpleStation14/Announcements/Systems/SharedAnnouncerSystem.cs b/Content.Shared/SimpleStation14/Announcements/Systems/SharedAnnouncerSystem.cs index 5618cc6850..a9da0c5d9a 100644 --- a/Content.Shared/SimpleStation14/Announcements/Systems/SharedAnnouncerSystem.cs +++ b/Content.Shared/SimpleStation14/Announcements/Systems/SharedAnnouncerSystem.cs @@ -24,8 +24,8 @@ public sealed class SharedAnnouncerSystem : EntitySystem // Get the announcement data from the announcer // Will be the fallback if the data for the announcementId is not found - var announcementType = announcer.AnnouncementPaths.FirstOrDefault(a => a.ID == announcementId) ?? - announcer.AnnouncementPaths.First(a => a.ID.ToLower() == "fallback"); + var announcementType = announcer.Announcements.FirstOrDefault(a => a.ID == announcementId) ?? + announcer.Announcements.First(a => a.ID.ToLower() == "fallback"); // If the greedy announcementType wants to do the job of announcer, ignore the base path and just return the path if (announcementType.IgnoreBasePath) @@ -46,8 +46,8 @@ public string GetAnnouncementPath(string announcementId, AnnouncerPrototype anno { // Get the announcement data from the announcer // Will be the fallback if the data for the announcementId is not found - var announcementType = announcer.AnnouncementPaths.FirstOrDefault(a => a.ID == announcementId) ?? - announcer.AnnouncementPaths.First(a => a.ID.ToLower() == "fallback"); + var announcementType = announcer.Announcements.FirstOrDefault(a => a.ID == announcementId) ?? + announcer.Announcements.First(a => a.ID.ToLower() == "fallback"); // If the greedy announcementType wants to do the job of announcer, ignore the base path and just return the path if (announcementType.IgnoreBasePath) @@ -72,8 +72,8 @@ public string GetAnnouncementPath(string announcementId, AnnouncerPrototype anno // Get the announcement data from the announcer // Will be the fallback if the data for the announcementId is not found - var announcementType = announcer.AnnouncementPaths.FirstOrDefault(a => a.ID == announcementId) ?? - announcer.AnnouncementPaths.First(a => a.ID == "fallback"); + var announcementType = announcer.Announcements.FirstOrDefault(a => a.ID == announcementId) ?? + announcer.Announcements.First(a => a.ID == "fallback"); // Return the announcer.BaseAudioParams if the announcementType doesn't have an override return announcementType.AudioParams ?? announcer.BaseAudioParams ?? null; // For some reason the formatter doesn't warn me about "?? null" being redundant, so it stays @@ -88,8 +88,8 @@ public string GetAnnouncementPath(string announcementId, AnnouncerPrototype anno { // Get the announcement data from the announcer // Will be the fallback if the data for the announcementId is not found - var announcementType = announcer.AnnouncementPaths.FirstOrDefault(a => a.ID == announcementId) ?? - announcer.AnnouncementPaths.First(a => a.ID == "fallback"); + var announcementType = announcer.Announcements.FirstOrDefault(a => a.ID == announcementId) ?? + announcer.Announcements.First(a => a.ID == "fallback"); // Return the announcer.BaseAudioParams if the announcementType doesn't have an override return announcementType.AudioParams ?? announcer.BaseAudioParams; @@ -108,8 +108,8 @@ public string GetAnnouncementPath(string announcementId, AnnouncerPrototype anno // Get the announcement data from the announcer // Will be the fallback if the data for the announcementId is not found - var announcementType = announcer.AnnouncementPaths.FirstOrDefault(a => a.ID == announcementId) ?? - announcer.AnnouncementPaths.First(a => a.ID == "fallback"); + var announcementType = announcer.Announcements.FirstOrDefault(a => a.ID == announcementId) ?? + announcer.Announcements.First(a => a.ID == "fallback"); // Return the announcementType.MessageOverride if it exists, otherwise return null return announcementType.MessageOverride != null ? Loc.GetString(announcementType.MessageOverride) : null; diff --git a/Resources/Prototypes/SimpleStation14/Announcers/intern.yml b/Resources/Prototypes/SimpleStation14/Announcers/intern.yml index c3adc5c3af..567eb8cb05 100644 --- a/Resources/Prototypes/SimpleStation14/Announcers/intern.yml +++ b/Resources/Prototypes/SimpleStation14/Announcers/intern.yml @@ -3,7 +3,7 @@ basePath: /Audio/SimpleStation14/Announcements/Intern baseAudioParams: volume: -7 - announcementPaths: + announcements: # Communications console - id: announce path: announce.ogg diff --git a/Resources/Prototypes/SimpleStation14/Announcers/medbot.yml b/Resources/Prototypes/SimpleStation14/Announcers/medbot.yml index b0ebe82524..587623706c 100644 --- a/Resources/Prototypes/SimpleStation14/Announcers/medbot.yml +++ b/Resources/Prototypes/SimpleStation14/Announcers/medbot.yml @@ -1,7 +1,7 @@ - type: announcer id: MedBot basePath: /Audio/SimpleStation14/Announcements/MedBot - announcementPaths: + announcements: # Communications console - id: announce path: announce.ogg diff --git a/Resources/Prototypes/SimpleStation14/Announcers/neil.yml b/Resources/Prototypes/SimpleStation14/Announcers/neil.yml index 3b763ccc4e..4dfa35c723 100644 --- a/Resources/Prototypes/SimpleStation14/Announcers/neil.yml +++ b/Resources/Prototypes/SimpleStation14/Announcers/neil.yml @@ -3,7 +3,7 @@ basePath: /Audio/SimpleStation14/Announcements/NEIL baseAudioParams: volume: -3 - announcementPaths: + announcements: # Communications console - id: announce path: announce.ogg diff --git a/Resources/Prototypes/SimpleStation14/Announcers/template b/Resources/Prototypes/SimpleStation14/Announcers/template index 739c2f7e2c..0c2c7b8410 100644 --- a/Resources/Prototypes/SimpleStation14/Announcers/template +++ b/Resources/Prototypes/SimpleStation14/Announcers/template @@ -11,7 +11,7 @@ basePath: /Audio/Codebase/Announcements/Announcer # Where to start looking for audio files baseAudioParams: # Default audio parameters for all announcements, all options explained later volume: -7 # if this example is really loud, lower it to match the others' volume - announcementPaths: # List of all announcements this announcer has audio for, comment out unused ones - don't remove them + announcements: # List of all announcements this announcer has audio for, comment out unused ones - don't remove them # Template - id: template # Lowercase of the event ID, add "-complete" to the end for post-event announcements (endings) ignoreBasePath: false # If true, it will ignore the basePath and use the path as is diff --git a/Resources/Prototypes/SimpleStation14/Announcers/voxfem.yml b/Resources/Prototypes/SimpleStation14/Announcers/voxfem.yml index 402dad0e11..098f41a9a5 100644 --- a/Resources/Prototypes/SimpleStation14/Announcers/voxfem.yml +++ b/Resources/Prototypes/SimpleStation14/Announcers/voxfem.yml @@ -1,7 +1,7 @@ - type: announcer id: VoxFem basePath: /Audio/SimpleStation14/Announcements/VoxFem - announcementPaths: + announcements: # Communications console - id: announce path: announce.ogg