From bc12a0af873822dd3d66df2927706e5cd6d3c4c9 Mon Sep 17 00:00:00 2001
From: keronshb <54602815+keronshb@users.noreply.github.com>
Date: Sun, 12 Jun 2022 19:45:26 -0400
Subject: [PATCH] Reorders the signature for sound (#2928)
---
.../Animations/AnimationTrackPlaySound.cs | 2 +-
.../GameObjects/EntitySystems/AudioSystem.cs | 8 +++++---
.../GameObjects/EntitySystems/AudioSystem.cs | 8 +++++---
Robust.Shared/Audio/IAudioSystem.cs | 13 ++++++------
Robust.Shared/Audio/SoundSystem.cs | 20 ++++++++++---------
5 files changed, 29 insertions(+), 22 deletions(-)
diff --git a/Robust.Client/Animations/AnimationTrackPlaySound.cs b/Robust.Client/Animations/AnimationTrackPlaySound.cs
index c915582c6..1ffd5f207 100644
--- a/Robust.Client/Animations/AnimationTrackPlaySound.cs
+++ b/Robust.Client/Animations/AnimationTrackPlaySound.cs
@@ -37,7 +37,7 @@ namespace Robust.Client.Animations
var keyFrame = KeyFrames[keyFrameIndex];
- SoundSystem.Play(Filter.Local(), keyFrame.Resource, entity, keyFrame.AudioParamsFunc.Invoke());
+ SoundSystem.Play(keyFrame.Resource, Filter.Local(), entity, keyFrame.AudioParamsFunc.Invoke());
}
return (keyFrameIndex, playingTime);
diff --git a/Robust.Client/GameObjects/EntitySystems/AudioSystem.cs b/Robust.Client/GameObjects/EntitySystems/AudioSystem.cs
index 703a5b140..f1d0a594c 100644
--- a/Robust.Client/GameObjects/EntitySystems/AudioSystem.cs
+++ b/Robust.Client/GameObjects/EntitySystems/AudioSystem.cs
@@ -481,19 +481,21 @@ namespace Robust.Client.GameObjects
public int OcclusionCollisionMask { get; set; }
///
- public IPlayingAudioStream? Play(Filter playerFilter, string filename, AudioParams? audioParams = null)
+ public IPlayingAudioStream? Play(string filename, Filter playerFilter, AudioParams? audioParams = null)
{
return Play(filename, audioParams);
}
///
- public IPlayingAudioStream? Play(Filter playerFilter, string filename, EntityUid entity, AudioParams? audioParams = null)
+ public IPlayingAudioStream? Play(string filename, Filter playerFilter, EntityUid entity,
+ AudioParams? audioParams = null)
{
return Play(filename, entity, GetFallbackCoordinates(EntityManager.GetComponent(entity).MapPosition), audioParams);
}
///
- public IPlayingAudioStream? Play(Filter playerFilter, string filename, EntityCoordinates coordinates, AudioParams? audioParams = null)
+ public IPlayingAudioStream? Play(string filename, Filter playerFilter, EntityCoordinates coordinates,
+ AudioParams? audioParams = null)
{
return Play(filename, coordinates, GetFallbackCoordinates(coordinates.ToMap(_entityManager)), audioParams);
}
diff --git a/Robust.Server/GameObjects/EntitySystems/AudioSystem.cs b/Robust.Server/GameObjects/EntitySystems/AudioSystem.cs
index 74a7df557..6c46bdd22 100644
--- a/Robust.Server/GameObjects/EntitySystems/AudioSystem.cs
+++ b/Robust.Server/GameObjects/EntitySystems/AudioSystem.cs
@@ -68,7 +68,7 @@ namespace Robust.Server.GameObjects
public int OcclusionCollisionMask { get; set; }
///
- public IPlayingAudioStream Play(Filter playerFilter, string filename, AudioParams? audioParams = null)
+ public IPlayingAudioStream? Play(string filename, Filter playerFilter, AudioParams? audioParams = null)
{
var id = CacheIdentifier();
var msg = new PlayAudioGlobalMessage
@@ -83,7 +83,8 @@ namespace Robust.Server.GameObjects
return new AudioSourceServer(this, id, playerFilter.Recipients.ToArray());
}
- public IPlayingAudioStream? Play(Filter playerFilter, string filename, EntityUid uid, AudioParams? audioParams = null)
+ public IPlayingAudioStream? Play(string filename, Filter playerFilter, EntityUid uid,
+ AudioParams? audioParams = null)
{
if(!EntityManager.TryGetComponent(uid, out var transform))
return null;
@@ -108,7 +109,8 @@ namespace Robust.Server.GameObjects
}
///
- public IPlayingAudioStream Play(Filter playerFilter, string filename, EntityCoordinates coordinates, AudioParams? audioParams = null)
+ public IPlayingAudioStream? Play(string filename, Filter playerFilter, EntityCoordinates coordinates,
+ AudioParams? audioParams = null)
{
var id = CacheIdentifier();
diff --git a/Robust.Shared/Audio/IAudioSystem.cs b/Robust.Shared/Audio/IAudioSystem.cs
index 9257e8bd6..44017639c 100644
--- a/Robust.Shared/Audio/IAudioSystem.cs
+++ b/Robust.Shared/Audio/IAudioSystem.cs
@@ -17,27 +17,28 @@ namespace Robust.Shared.Audio
///
/// Play an audio file globally, without position.
///
- /// The set of players that will hear the sound.
/// The resource path to the OGG Vorbis file to play.
+ /// The set of players that will hear the sound.
/// Audio parameters to apply when playing the sound.
- IPlayingAudioStream? Play(Filter playerFilter, string filename, AudioParams? audioParams = null);
+ IPlayingAudioStream? Play(string filename, Filter playerFilter, AudioParams? audioParams = null);
///
/// Play an audio file following an entity.
///
- /// The set of players that will hear the sound.
/// The resource path to the OGG Vorbis file to play.
+ /// The set of players that will hear the sound.
/// The UID of the entity "emitting" the audio.
/// Audio parameters to apply when playing the sound.
- IPlayingAudioStream? Play(Filter playerFilter, string filename, EntityUid uid, AudioParams? audioParams = null);
+ IPlayingAudioStream? Play(string filename, Filter playerFilter, EntityUid uid, AudioParams? audioParams = null);
///
/// Play an audio file at a static position.
///
- /// The set of players that will hear the sound.
/// The resource path to the OGG Vorbis file to play.
+ /// The set of players that will hear the sound.
/// The coordinates at which to play the audio.
/// Audio parameters to apply when playing the sound.
- IPlayingAudioStream? Play(Filter playerFilter, string filename, EntityCoordinates coordinates, AudioParams? audioParams = null);
+ IPlayingAudioStream? Play(string filename, Filter playerFilter, EntityCoordinates coordinates,
+ AudioParams? audioParams = null);
}
}
diff --git a/Robust.Shared/Audio/SoundSystem.cs b/Robust.Shared/Audio/SoundSystem.cs
index 54c90ccf8..162906f5c 100644
--- a/Robust.Shared/Audio/SoundSystem.cs
+++ b/Robust.Shared/Audio/SoundSystem.cs
@@ -37,36 +37,38 @@ namespace Robust.Shared.Audio
///
/// Play an audio file globally, without position.
///
- /// The set of players that will hear the sound.
/// The resource path to the OGG Vorbis file to play.
+ /// The set of players that will hear the sound.
/// Audio parameters to apply when playing the sound.
- public static IPlayingAudioStream? Play(Filter playerFilter, string filename, AudioParams? audioParams = null)
+ public static IPlayingAudioStream? Play(string filename, Filter playerFilter, AudioParams? audioParams = null)
{
- return GetAudio()?.Play(playerFilter, filename, audioParams);
+ return GetAudio()?.Play(filename, playerFilter, audioParams);
}
///
/// Play an audio file following an entity.
///
- /// The set of players that will hear the sound.
/// The resource path to the OGG Vorbis file to play.
+ /// The set of players that will hear the sound.
/// The UID of the entity "emitting" the audio.
/// Audio parameters to apply when playing the sound.
- public static IPlayingAudioStream? Play(Filter playerFilter, string filename, EntityUid uid, AudioParams? audioParams = null)
+ public static IPlayingAudioStream? Play(string filename, Filter playerFilter, EntityUid uid,
+ AudioParams? audioParams = null)
{
- return GetAudio()?.Play(playerFilter, filename, uid, audioParams);
+ return GetAudio()?.Play(filename, playerFilter, uid, audioParams);
}
///
/// Play an audio file at a static position.
///
- /// The set of players that will hear the sound.
/// The resource path to the OGG Vorbis file to play.
+ /// The set of players that will hear the sound.
/// The coordinates at which to play the audio.
/// Audio parameters to apply when playing the sound.
- public static IPlayingAudioStream? Play(Filter playerFilter, string filename, EntityCoordinates coordinates, AudioParams? audioParams = null)
+ public static IPlayingAudioStream? Play(string filename, Filter playerFilter, EntityCoordinates coordinates,
+ AudioParams? audioParams = null)
{
- return GetAudio()?.Play(playerFilter, filename, coordinates, audioParams);
+ return GetAudio()?.Play(filename, playerFilter, coordinates, audioParams);
}
internal sealed class QueryAudioSystem : EntityEventArgs