Predict EmitSoundOnUIOpen (#31464)

* Predict EmitSoundOnUIOpen

BUI prediction led to this moment.

* unforky
This commit is contained in:
metalgearsloth
2024-08-26 17:40:14 +10:00
committed by GitHub
parent 2e1b486e8b
commit 83ec967455
4 changed files with 18 additions and 19 deletions

View File

@@ -1,12 +0,0 @@
using Content.Shared.Sound.Components;
namespace Content.Server.Sound.Components
{
/// <summary>
/// Simple sound emitter that emits sound on AfterActivatableUIOpenEvent
/// </summary>
[RegisterComponent]
public sealed partial class EmitSoundOnUIOpenComponent : BaseEmitSoundComponent
{
}
}

View File

@@ -39,15 +39,9 @@ public sealed class EmitSoundSystem : SharedEmitSoundSystem
base.Initialize();
SubscribeLocalEvent<EmitSoundOnTriggerComponent, TriggerEvent>(HandleEmitSoundOnTrigger);
SubscribeLocalEvent<EmitSoundOnUIOpenComponent, AfterActivatableUIOpenEvent>(HandleEmitSoundOnUIOpen);
SubscribeLocalEvent<SpamEmitSoundComponent, MapInitEvent>(HandleSpamEmitSoundMapInit);
}
private void HandleEmitSoundOnUIOpen(EntityUid uid, EmitSoundOnUIOpenComponent component, AfterActivatableUIOpenEvent args)
{
TryEmitSound(uid, component, args.User, false);
}
private void HandleEmitSoundOnTrigger(EntityUid uid, EmitSoundOnTriggerComponent component, TriggerEvent args)
{
TryEmitSound(uid, component, args.User, false);