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

@@ -195,6 +195,9 @@ namespace Content.Server.Kitchen.EntitySystems
while (_uiUpdateQueue.TryDequeue(out var comp))
{
if(comp.Deleted)
continue;
bool canJuice = false;
bool canGrind = false;
if (comp.BeakerContainer.ContainedEntity != null)

View File

@@ -20,8 +20,6 @@ namespace Content.Server.Light.Components
[RegisterComponent]
public class ExpendableLightComponent : SharedExpendableLightComponent, IUse
{
private static readonly AudioParams LoopedSoundParams = new(0, 1, "Master", 62.5f, 1, true, 0.3f);
/// <summary>
/// Status of light, whether or not it is emitting light.
/// </summary>
@@ -77,18 +75,20 @@ namespace Content.Server.Light.Components
private void UpdateVisualizer()
{
_appearance?.SetData(ExpendableLightVisuals.State, CurrentState);
switch (CurrentState)
{
case ExpendableLightState.Lit:
_appearance?.SetData(ExpendableLightVisuals.State, TurnOnBehaviourID);
_appearance?.SetData(ExpendableLightVisuals.Behavior, TurnOnBehaviourID);
break;
case ExpendableLightState.Fading:
_appearance?.SetData(ExpendableLightVisuals.State, FadeOutBehaviourID);
_appearance?.SetData(ExpendableLightVisuals.Behavior, FadeOutBehaviourID);
break;
case ExpendableLightState.Dead:
_appearance?.SetData(ExpendableLightVisuals.State, string.Empty);
_appearance?.SetData(ExpendableLightVisuals.Behavior, string.Empty);
break;
}
}
@@ -100,12 +100,6 @@ namespace Content.Server.Light.Components
switch (CurrentState)
{
case ExpendableLightState.Lit:
if (LoopedSound != string.Empty && Owner.TryGetComponent<LoopingLoopingSoundComponent>(out var loopingSound))
{
loopingSound.Play(LoopedSound, LoopedSoundParams);
}
if (LitSound != string.Empty)
{
SoundSystem.Play(Filter.Pvs(Owner), LitSound, Owner);
@@ -131,11 +125,6 @@ namespace Content.Server.Light.Components
SoundSystem.Play(Filter.Pvs(Owner), DieSound, Owner);
}
if (LoopedSound != string.Empty && Owner.TryGetComponent<LoopingLoopingSoundComponent>(out var loopSound))
{
loopSound.StopAllSounds();
}
sprite.LayerSetState(0, IconStateSpent);
sprite.LayerSetShader(0, "shaded");
sprite.LayerSetVisible(1, false);

View File

@@ -1,67 +0,0 @@
using Content.Shared.Sound;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Network;
namespace Content.Server.Sound.Components
{
[RegisterComponent]
public class LoopingLoopingSoundComponent : SharedLoopingSoundComponent
{
/// <summary>
/// Stops all sounds.
/// </summary>
/// <param name="channel">User that will be affected.</param>
public void StopAllSounds(INetChannel? channel)
{
SendNetworkMessage(new StopAllSoundsMessage(), channel);
}
/// <summary>
/// Stops a certain scheduled sound from playing.
/// </summary>
/// <param name="channel">User that will be affected.</param>
public void StopScheduledSound(string filename, INetChannel? channel)
{
SendNetworkMessage(new StopSoundScheduleMessage() {Filename = filename}, channel);
}
/// <summary>
/// Adds an scheduled sound to be played.
/// </summary>
/// <param name="channel">User that will be affected.</param>
public void AddScheduledSound(ScheduledSound schedule, INetChannel? channel)
{
SendNetworkMessage(new ScheduledSoundMessage() {Schedule = schedule}, channel);
}
public override void StopAllSounds()
{
StopAllSounds(null);
}
public override void StopScheduledSound(string filename)
{
StopScheduledSound(filename, null);
}
public override void AddScheduledSound(ScheduledSound schedule)
{
AddScheduledSound(schedule, null);
}
/// <summary>
/// Play an audio file following the entity.
/// </summary>
/// <param name="filename">The resource path to the OGG Vorbis file to play.</param>
/// <param name="channel">User that will be affected.</param>
public void Play(string filename, AudioParams? audioParams = null, INetChannel? channel = null)
{
AddScheduledSound(new ScheduledSound()
{
Filename = filename,
AudioParams = audioParams,
}, channel);
}
}
}