Muzzles reduce emote sound (#34444)
* Muzzles reduce emote sound * update based on review comments * review comments
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Frozen;
|
||||
using Content.Shared.Chat.Prototypes;
|
||||
using Content.Shared.Speech;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
@@ -126,16 +127,16 @@ public partial class ChatSystem
|
||||
/// Tries to find and play relevant emote sound in emote sounds collection.
|
||||
/// </summary>
|
||||
/// <returns>True if emote sound was played.</returns>
|
||||
public bool TryPlayEmoteSound(EntityUid uid, EmoteSoundsPrototype? proto, EmotePrototype emote)
|
||||
public bool TryPlayEmoteSound(EntityUid uid, EmoteSoundsPrototype? proto, EmotePrototype emote, AudioParams? audioParams = null)
|
||||
{
|
||||
return TryPlayEmoteSound(uid, proto, emote.ID);
|
||||
return TryPlayEmoteSound(uid, proto, emote.ID, audioParams);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to find and play relevant emote sound in emote sounds collection.
|
||||
/// </summary>
|
||||
/// <returns>True if emote sound was played.</returns>
|
||||
public bool TryPlayEmoteSound(EntityUid uid, EmoteSoundsPrototype? proto, string emoteId)
|
||||
public bool TryPlayEmoteSound(EntityUid uid, EmoteSoundsPrototype? proto, string emoteId, AudioParams? audioParams = null)
|
||||
{
|
||||
if (proto == null)
|
||||
return false;
|
||||
@@ -149,8 +150,8 @@ public partial class ChatSystem
|
||||
return false;
|
||||
}
|
||||
|
||||
// if general params for all sounds set - use them
|
||||
var param = proto.GeneralParams ?? sound.Params;
|
||||
// optional override params > general params for all sounds in set > individual sound params
|
||||
var param = audioParams ?? proto.GeneralParams ?? sound.Params;
|
||||
_audio.PlayPvs(sound, uid, param);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user