mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Reorders the signature for sound (#2928)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -481,19 +481,21 @@ namespace Robust.Client.GameObjects
|
||||
public int OcclusionCollisionMask { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IPlayingAudioStream? Play(Filter playerFilter, string filename, AudioParams? audioParams = null)
|
||||
public IPlayingAudioStream? Play(string filename, Filter playerFilter, AudioParams? audioParams = null)
|
||||
{
|
||||
return Play(filename, audioParams);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
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<TransformComponent>(entity).MapPosition), audioParams);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Robust.Server.GameObjects
|
||||
public int OcclusionCollisionMask { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
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<TransformComponent>(uid, out var transform))
|
||||
return null;
|
||||
@@ -108,7 +109,8 @@ namespace Robust.Server.GameObjects
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
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();
|
||||
|
||||
|
||||
@@ -17,27 +17,28 @@ namespace Robust.Shared.Audio
|
||||
/// <summary>
|
||||
/// Play an audio file globally, without position.
|
||||
/// </summary>
|
||||
/// <param name="playerFilter">The set of players that will hear the sound.</param>
|
||||
/// <param name="filename">The resource path to the OGG Vorbis file to play.</param>
|
||||
/// <param name="playerFilter">The set of players that will hear the sound.</param>
|
||||
/// <param name="audioParams">Audio parameters to apply when playing the sound.</param>
|
||||
IPlayingAudioStream? Play(Filter playerFilter, string filename, AudioParams? audioParams = null);
|
||||
IPlayingAudioStream? Play(string filename, Filter playerFilter, AudioParams? audioParams = null);
|
||||
|
||||
/// <summary>
|
||||
/// Play an audio file following an entity.
|
||||
/// </summary>
|
||||
/// <param name="playerFilter">The set of players that will hear the sound.</param>
|
||||
/// <param name="filename">The resource path to the OGG Vorbis file to play.</param>
|
||||
/// <param name="playerFilter">The set of players that will hear the sound.</param>
|
||||
/// <param name="uid">The UID of the entity "emitting" the audio.</param>
|
||||
/// <param name="audioParams">Audio parameters to apply when playing the sound.</param>
|
||||
IPlayingAudioStream? Play(Filter playerFilter, string filename, EntityUid uid, AudioParams? audioParams = null);
|
||||
IPlayingAudioStream? Play(string filename, Filter playerFilter, EntityUid uid, AudioParams? audioParams = null);
|
||||
|
||||
/// <summary>
|
||||
/// Play an audio file at a static position.
|
||||
/// </summary>
|
||||
/// <param name="playerFilter">The set of players that will hear the sound.</param>
|
||||
/// <param name="filename">The resource path to the OGG Vorbis file to play.</param>
|
||||
/// <param name="playerFilter">The set of players that will hear the sound.</param>
|
||||
/// <param name="coordinates">The coordinates at which to play the audio.</param>
|
||||
/// <param name="audioParams">Audio parameters to apply when playing the sound.</param>
|
||||
IPlayingAudioStream? Play(Filter playerFilter, string filename, EntityCoordinates coordinates, AudioParams? audioParams = null);
|
||||
IPlayingAudioStream? Play(string filename, Filter playerFilter, EntityCoordinates coordinates,
|
||||
AudioParams? audioParams = null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,36 +37,38 @@ namespace Robust.Shared.Audio
|
||||
/// <summary>
|
||||
/// Play an audio file globally, without position.
|
||||
/// </summary>
|
||||
/// <param name="playerFilter">The set of players that will hear the sound.</param>
|
||||
/// <param name="filename">The resource path to the OGG Vorbis file to play.</param>
|
||||
/// <param name="playerFilter">The set of players that will hear the sound.</param>
|
||||
/// <param name="audioParams">Audio parameters to apply when playing the sound.</param>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Play an audio file following an entity.
|
||||
/// </summary>
|
||||
/// <param name="playerFilter">The set of players that will hear the sound.</param>
|
||||
/// <param name="filename">The resource path to the OGG Vorbis file to play.</param>
|
||||
/// <param name="playerFilter">The set of players that will hear the sound.</param>
|
||||
/// <param name="uid">The UID of the entity "emitting" the audio.</param>
|
||||
/// <param name="audioParams">Audio parameters to apply when playing the sound.</param>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Play an audio file at a static position.
|
||||
/// </summary>
|
||||
/// <param name="playerFilter">The set of players that will hear the sound.</param>
|
||||
/// <param name="filename">The resource path to the OGG Vorbis file to play.</param>
|
||||
/// <param name="playerFilter">The set of players that will hear the sound.</param>
|
||||
/// <param name="coordinates">The coordinates at which to play the audio.</param>
|
||||
/// <param name="audioParams">Audio parameters to apply when playing the sound.</param>
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user