From 47107c6a42f41bb42715c667b8244d2121887524 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Fri, 1 Oct 2021 12:40:44 +0200 Subject: [PATCH] Adds linting support to SoundCollectionPrototype, fix linter errors. Closes #4580 --- Content.Client/Audio/BackgroundAudioSystem.cs | 2 +- Content.Server/GameTicking/GameTicker.LobbyMusic.cs | 2 +- Content.Server/GameTicking/GameTicker.RoundFlow.cs | 2 +- Content.Shared/Audio/AudioHelpers.cs | 2 +- Content.Shared/Audio/SoundCollectionPrototype.cs | 4 +++- .../Voice/Human/{Scientist => }/science_scream1.ogg | Bin .../Voice/Human/{Scientist => }/science_scream2.ogg | Bin .../Voice/Human/{Scientist => }/science_scream3.ogg | Bin .../Voice/Human/{Scientist => }/science_scream4.ogg | Bin .../Voice/Human/{Scientist => }/science_scream5.ogg | Bin .../Voice/Human/{Scientist => }/science_scream6.ogg | Bin Resources/Prototypes/SoundCollections/footsteps.yml | 9 ++++----- Resources/Prototypes/SoundCollections/screams.yml | 12 ++++++------ 13 files changed, 17 insertions(+), 16 deletions(-) rename Resources/Audio/Voice/Human/{Scientist => }/science_scream1.ogg (100%) rename Resources/Audio/Voice/Human/{Scientist => }/science_scream2.ogg (100%) rename Resources/Audio/Voice/Human/{Scientist => }/science_scream3.ogg (100%) rename Resources/Audio/Voice/Human/{Scientist => }/science_scream4.ogg (100%) rename Resources/Audio/Voice/Human/{Scientist => }/science_scream5.ogg (100%) rename Resources/Audio/Voice/Human/{Scientist => }/science_scream6.ogg (100%) diff --git a/Content.Client/Audio/BackgroundAudioSystem.cs b/Content.Client/Audio/BackgroundAudioSystem.cs index 3b5480e0f7..29f7c98187 100644 --- a/Content.Client/Audio/BackgroundAudioSystem.cs +++ b/Content.Client/Audio/BackgroundAudioSystem.cs @@ -126,7 +126,7 @@ namespace Content.Client.Audio private void StartAmbience() { EndAmbience(); - var file = _robustRandom.Pick(_ambientCollection.PickFiles); + var file = _robustRandom.Pick(_ambientCollection.PickFiles).ToString(); _ambientStream = SoundSystem.Play(Filter.Local(), file, _ambientParams); } diff --git a/Content.Server/GameTicking/GameTicker.LobbyMusic.cs b/Content.Server/GameTicking/GameTicker.LobbyMusic.cs index a13ca046a0..39ae8f1f62 100644 --- a/Content.Server/GameTicking/GameTicker.LobbyMusic.cs +++ b/Content.Server/GameTicking/GameTicker.LobbyMusic.cs @@ -64,7 +64,7 @@ namespace Content.Server.GameTicking public void ChooseRandomLobbySong() { DebugTools.Assert(_lobbyMusicInitialized); - SetLobbySong(_robustRandom.Pick(_lobbyMusicCollection.PickFiles)); + SetLobbySong(_robustRandom.Pick(_lobbyMusicCollection.PickFiles).ToString()); } /// diff --git a/Content.Server/GameTicking/GameTicker.RoundFlow.cs b/Content.Server/GameTicking/GameTicker.RoundFlow.cs index e65c191f1c..e8e33bcb73 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -246,7 +246,7 @@ namespace Content.Server.GameTicking RoundNumberMetric.Inc(); RunLevel = GameRunLevel.PreRoundLobby; - LobbySong = _robustRandom.Pick(_lobbyMusicCollection.PickFiles); + LobbySong = _robustRandom.Pick(_lobbyMusicCollection.PickFiles).ToString(); ResettingCleanup(); PreRoundSetup(); diff --git a/Content.Shared/Audio/AudioHelpers.cs b/Content.Shared/Audio/AudioHelpers.cs index a8a47fbdf5..877de36c9d 100644 --- a/Content.Shared/Audio/AudioHelpers.cs +++ b/Content.Shared/Audio/AudioHelpers.cs @@ -55,7 +55,7 @@ namespace Content.Shared.Audio public static string GetRandomFileFromSoundCollection(string name) { var soundCollection = IoCManager.Resolve().Index(name); - return IoCManager.Resolve().Pick(soundCollection.PickFiles); + return IoCManager.Resolve().Pick(soundCollection.PickFiles).ToString(); } } } diff --git a/Content.Shared/Audio/SoundCollectionPrototype.cs b/Content.Shared/Audio/SoundCollectionPrototype.cs index 45b615c790..5b9c78f025 100644 --- a/Content.Shared/Audio/SoundCollectionPrototype.cs +++ b/Content.Shared/Audio/SoundCollectionPrototype.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.Manager.Attributes; +using Robust.Shared.Utility; using Robust.Shared.ViewVariables; namespace Content.Shared.Audio @@ -12,6 +13,7 @@ namespace Content.Shared.Audio [DataField("id", required: true)] public string ID { get; } = default!; - [DataField("files")] public List PickFiles { get; } = new(); + [DataField("files")] + public List PickFiles { get; } = new(); } } diff --git a/Resources/Audio/Voice/Human/Scientist/science_scream1.ogg b/Resources/Audio/Voice/Human/science_scream1.ogg similarity index 100% rename from Resources/Audio/Voice/Human/Scientist/science_scream1.ogg rename to Resources/Audio/Voice/Human/science_scream1.ogg diff --git a/Resources/Audio/Voice/Human/Scientist/science_scream2.ogg b/Resources/Audio/Voice/Human/science_scream2.ogg similarity index 100% rename from Resources/Audio/Voice/Human/Scientist/science_scream2.ogg rename to Resources/Audio/Voice/Human/science_scream2.ogg diff --git a/Resources/Audio/Voice/Human/Scientist/science_scream3.ogg b/Resources/Audio/Voice/Human/science_scream3.ogg similarity index 100% rename from Resources/Audio/Voice/Human/Scientist/science_scream3.ogg rename to Resources/Audio/Voice/Human/science_scream3.ogg diff --git a/Resources/Audio/Voice/Human/Scientist/science_scream4.ogg b/Resources/Audio/Voice/Human/science_scream4.ogg similarity index 100% rename from Resources/Audio/Voice/Human/Scientist/science_scream4.ogg rename to Resources/Audio/Voice/Human/science_scream4.ogg diff --git a/Resources/Audio/Voice/Human/Scientist/science_scream5.ogg b/Resources/Audio/Voice/Human/science_scream5.ogg similarity index 100% rename from Resources/Audio/Voice/Human/Scientist/science_scream5.ogg rename to Resources/Audio/Voice/Human/science_scream5.ogg diff --git a/Resources/Audio/Voice/Human/Scientist/science_scream6.ogg b/Resources/Audio/Voice/Human/science_scream6.ogg similarity index 100% rename from Resources/Audio/Voice/Human/Scientist/science_scream6.ogg rename to Resources/Audio/Voice/Human/science_scream6.ogg diff --git a/Resources/Prototypes/SoundCollections/footsteps.yml b/Resources/Prototypes/SoundCollections/footsteps.yml index 171c39c0c5..9b49b9582b 100644 --- a/Resources/Prototypes/SoundCollections/footsteps.yml +++ b/Resources/Prototypes/SoundCollections/footsteps.yml @@ -55,11 +55,10 @@ - type: soundCollection id: footstep_tile files: - - /Audio/Effects/Footsteps/tile1.ogg - - /Audio/Effects/Footsteps/tile2.ogg - - /Audio/Effects/Footsteps/tile3.ogg - - /Audio/Effects/Footsteps/tile4.ogg - - /Audio/Effects/Footsteps/tile5.ogg + - /Audio/Effects/Footsteps/tile1.wav + - /Audio/Effects/Footsteps/tile2.wav + - /Audio/Effects/Footsteps/tile3.wav + - /Audio/Effects/Footsteps/tile4.wav - type: soundCollection id: footstep_clown diff --git a/Resources/Prototypes/SoundCollections/screams.yml b/Resources/Prototypes/SoundCollections/screams.yml index 5d7fda10a2..1033215005 100644 --- a/Resources/Prototypes/SoundCollections/screams.yml +++ b/Resources/Prototypes/SoundCollections/screams.yml @@ -20,9 +20,9 @@ - type: soundCollection id: ScientistScreams files: - - /Audio/Voice/Human/science_scream_1.ogg - - /Audio/Voice/Human/science_scream_2.ogg - - /Audio/Voice/Human/science_scream_3.ogg - - /Audio/Voice/Human/science_scream_4.ogg - - /Audio/Voice/Human/science_scream_5.ogg - - /Audio/Voice/Human/science_scream_6.ogg + - /Audio/Voice/Human/science_scream1.ogg + - /Audio/Voice/Human/science_scream2.ogg + - /Audio/Voice/Human/science_scream3.ogg + - /Audio/Voice/Human/science_scream4.ogg + - /Audio/Voice/Human/science_scream5.ogg + - /Audio/Voice/Human/science_scream6.ogg