Removes LoopingSoundComponent. (#4396)

I'm sorry.
This commit is contained in:
Vera Aguilera Puerto
2021-07-31 12:41:59 +02:00
committed by GitHub
parent f93bdcd226
commit dc18997bf8
50 changed files with 120 additions and 380 deletions

View File

@@ -0,0 +1,31 @@
using System;
using Content.Client.Kitchen.Components;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
namespace Content.Client.Kitchen.EntitySystems
{
public class MicrowaveSystem : EntitySystem
{
public void StartSoundLoop(MicrowaveComponent microwave)
{
StopSoundLoop(microwave);
microwave.PlayingStream = SoundSystem.Play(Filter.Local(), microwave.LoopingSound.GetSound(), microwave.Owner,
AudioParams.Default.WithAttenuation(1).WithMaxDistance(5).WithLoop(true));
}
public void StopSoundLoop(MicrowaveComponent microwave)
{
try
{
microwave.PlayingStream?.Stop();
}
catch (Exception _)
{
// TODO: HOLY SHIT EXPOSE SOME DISPOSED PROPERTY ON PLAYING STREAM OR SOMETHING.
}
}
}
}