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

@@ -1,9 +1,11 @@
using System.Linq;
using System.Linq;
using Content.Shared.Audio;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Player;
using Robust.Shared.Random;
namespace Content.Server.GameObjects.Components.Items.Storage
@@ -45,8 +47,8 @@ namespace Content.Server.GameObjects.Components.Items.Storage
locker.Insert(entity);
}
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/teleport_departure.ogg", Owner, AudioHelpers.WithVariation(0.125f));
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/teleport_arrival.ogg", lockerEnt, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/teleport_departure.ogg", Owner, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(lockerEnt), "/Audio/Effects/teleport_arrival.ogg", lockerEnt, AudioHelpers.WithVariation(0.125f));
}
}
}

View File

@@ -14,6 +14,7 @@ using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Physics;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
@@ -21,6 +22,7 @@ using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Physics;
using Robust.Shared.Player;
using Robust.Shared.Serialization;
using Robust.Shared.Timing;
using Robust.Shared.ViewVariables;
@@ -223,7 +225,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
}
ModifyComponents();
EntitySystem.Get<AudioSystem>().PlayFromEntity(_closeSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), _closeSound, Owner);
_lastInternalOpenAttempt = default;
}
@@ -232,7 +234,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
Open = true;
EmptyContents();
ModifyComponents();
EntitySystem.Get<AudioSystem>().PlayFromEntity(_openSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), _openSound, Owner);
}
private void ModifyComponents()

View File

@@ -8,6 +8,7 @@ using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -98,7 +99,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
if (!CheckAccess(user)) return;
Locked = false;
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/door_lock_off.ogg", Owner, AudioParams.Default.WithVolume(-5));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/door_lock_off.ogg", Owner, AudioParams.Default.WithVolume(-5));
}
private void DoLock(IEntity user)
@@ -106,7 +107,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
if (!CheckAccess(user)) return;
Locked = true;
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/door_lock_on.ogg", Owner, AudioParams.Default.WithVolume(-5));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/door_lock_on.ogg", Owner, AudioParams.Default.WithVolume(-5));
}
private bool CheckAccess(IEntity user)

View File

@@ -22,6 +22,7 @@ using Robust.Shared.GameObjects;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -620,8 +621,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
}
var file = AudioHelpers.GetRandomFileFromSoundCollection(name);
EntitySystem.Get<AudioSystem>()
.PlayFromEntity(file, Owner, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(Owner), file, Owner, AudioParams.Default);
}
}
}