Merge branch 'master' into replace-sounds-with-sound-specifier

# Conflicts:
#	Content.Server/Hands/Components/HandsComponent.cs
#	Content.Server/Light/Components/ExpendableLightComponent.cs
#	Content.Shared/Light/Component/SharedExpendableLightComponent.cs
This commit is contained in:
Galactic Chimp
2021-07-31 13:16:03 +02:00
105 changed files with 1483 additions and 1319 deletions

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.TryGetSound(out var litSound))
{
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);