Fix keyboard sounds not playing when opening a computer UI (#24348)

Fix keyboard sounds not playing on UI open

(cherry picked from commit 60dd9f8951ae1bc742fde9122bf6da2a7a2c1f17)
This commit is contained in:
Nemanja 2024-01-21 02:36:03 -05:00 committed by Debug
parent 2c40401765
commit 4b938fdea8
No known key found for this signature in database
GPG Key ID: 271270A74EF9C350
2 changed files with 5 additions and 3 deletions

View File

@ -29,7 +29,7 @@ public sealed class EmitSoundSystem : SharedEmitSoundSystem
{
if (soundSpammer.PopUp != null)
Popup.PopupEntity(Loc.GetString(soundSpammer.PopUp), uid);
TryEmitSound(uid, soundSpammer);
TryEmitSound(uid, soundSpammer, predict: false);
}
}
}
@ -44,12 +44,12 @@ public sealed class EmitSoundSystem : SharedEmitSoundSystem
private void HandleEmitSoundOnUIOpen(EntityUid uid, EmitSoundOnUIOpenComponent component, AfterActivatableUIOpenEvent args)
{
TryEmitSound(uid, component, args.User);
TryEmitSound(uid, component, args.User, false);
}
private void HandleEmitSoundOnTrigger(EntityUid uid, EmitSoundOnTriggerComponent component, TriggerEvent args)
{
TryEmitSound(uid, component);
TryEmitSound(uid, component, args.User, false);
args.Handled = true;
}
}

View File

@ -52,6 +52,8 @@
- type: EmitSoundOnUIOpen
sound:
collection: Keyboard
params:
volume: -1
- type: ContainerContainer
containers:
board: !type:Container