Content audio (#20862)

This commit is contained in:
metalgearsloth
2023-10-29 14:58:23 +11:00
committed by GitHub
parent cd280eef6b
commit 9b1b3e03ed
326 changed files with 890 additions and 436 deletions

View File

@@ -11,6 +11,7 @@ using Content.Shared.Storage.Components;
using Content.Shared.Verbs;
using JetBrains.Annotations;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Utility;
namespace Content.Shared.Lock;
@@ -102,11 +103,11 @@ public sealed class LockSystem : EntitySystem
_sharedPopupSystem.PopupClient(Loc.GetString("lock-comp-do-lock-success",
("entityName", Identity.Name(uid, EntityManager))), uid, user);
_audio.PlayPredicted(lockComp.LockSound, uid, user, AudioParams.Default.WithVolume(-5));
_audio.PlayPredicted(lockComp.LockSound, uid, user);
lockComp.Locked = true;
_appearanceSystem.SetData(uid, StorageVisuals.Locked, true);
Dirty(lockComp);
Dirty(uid, lockComp);
var ev = new LockToggledEvent(true);
RaiseLocalEvent(uid, ref ev, true);
@@ -130,11 +131,11 @@ public sealed class LockSystem : EntitySystem
("entityName", Identity.Name(uid, EntityManager))), uid, user.Value);
}
_audio.PlayPredicted(lockComp.UnlockSound, uid, user, AudioParams.Default.WithVolume(-5));
_audio.PlayPredicted(lockComp.UnlockSound, uid, user);
lockComp.Locked = false;
_appearanceSystem.SetData(uid, StorageVisuals.Locked, false);
Dirty(lockComp);
Dirty(uid, lockComp);
var ev = new LockToggledEvent(false);
RaiseLocalEvent(uid, ref ev, true);
@@ -213,7 +214,7 @@ public sealed class LockSystem : EntitySystem
{
if (!component.Locked || !component.BreakOnEmag)
return;
_audio.PlayPredicted(component.UnlockSound, uid, null, AudioParams.Default.WithVolume(-5));
_audio.PlayPredicted(component.UnlockSound, uid, null);
_appearanceSystem.SetData(uid, StorageVisuals.Locked, false);
RemComp<LockComponent>(uid); //Literally destroys the lock as a tell it was emagged
args.Handled = true;