SoundSystem Improvements (#3697)

* Refactor all audio to use the new SoundSystem.

* Update submodule

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
Acruid
2021-03-21 09:12:03 -07:00
committed by GitHub
parent d4030edff6
commit 9459400002
104 changed files with 401 additions and 279 deletions

View File

@@ -12,11 +12,13 @@ using Content.Shared.GameObjects.Verbs;
using Content.Shared.Interfaces;
using Content.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Log;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.ViewVariables;
@@ -228,15 +230,14 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
if (isOwner)
{
if (cuff.StartBreakoutSound != null)
audio.PlayFromEntity(cuff.StartBreakoutSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), cuff.StartBreakoutSound, Owner);
}
else
{
if (cuff.StartUncuffSound != null)
audio.PlayFromEntity(cuff.StartUncuffSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), cuff.StartUncuffSound, Owner);
}
var uncuffTime = isOwner ? cuff.BreakoutTime : cuff.UncuffTime;
var doAfterEventArgs = new DoAfterEventArgs(user, uncuffTime)
{
@@ -256,7 +257,7 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
if (result != DoAfterStatus.Cancelled)
{
if (cuff.EndUncuffSound != null)
audio.PlayFromEntity(cuff.EndUncuffSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), cuff.EndUncuffSound, Owner);
Container.ForceRemove(cuffsToRemove);
cuffsToRemove.Transform.AttachToGridOrMap();

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.GUI;
@@ -10,9 +10,11 @@ using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -183,7 +185,7 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
eventArgs.User.PopupMessage(eventArgs.Target, Loc.GetString("{0:theName} starts cuffing you!", eventArgs.User));
if (StartCuffSound != null)
EntitySystem.Get<AudioSystem>().PlayFromEntity(StartCuffSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), StartCuffSound, Owner);
TryUpdateCuff(eventArgs.User, eventArgs.Target, cuffed);
return true;
@@ -221,7 +223,7 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
if (cuffs.TryAddNewCuffs(user, Owner))
{
if (EndCuffSound != null)
EntitySystem.Get<AudioSystem>().PlayFromEntity(EndCuffSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), EndCuffSound, Owner);
user.PopupMessage(Loc.GetString("You successfully cuff {0:theName}.", target));
target.PopupMessage(Loc.GetString("You have been cuffed by {0:theName}!", user));