prevent typing sound from playing when AI interacts with consoles (#32906)

* prevent typing sound from playing when AI interacts with consoles

* cleanup
This commit is contained in:
MendaxxDev
2024-10-21 05:50:05 +02:00
committed by GitHub
parent 1d2ad3c335
commit b5687e4c73
6 changed files with 18 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
using Content.Shared.Whitelist;
using Robust.Shared.GameStates;
namespace Content.Shared.Sound.Components;
@@ -8,4 +9,9 @@ namespace Content.Shared.Sound.Components;
[RegisterComponent, NetworkedComponent]
public sealed partial class EmitSoundOnUIOpenComponent : BaseEmitSoundComponent
{
/// <summary>
/// Blacklist for making the sound not play if certain entities open the UI
/// </summary>
[DataField]
public EntityWhitelist Blacklist = new();
}

View File

@@ -57,9 +57,12 @@ public abstract class SharedEmitSoundSystem : EntitySystem
}
private void HandleEmitSoundOnUIOpen(EntityUid uid, EmitSoundOnUIOpenComponent component, AfterActivatableUIOpenEvent args)
{
if (_whitelistSystem.IsBlacklistFail(component.Blacklist, args.User))
{
TryEmitSound(uid, component, args.User);
}
}
private void OnMobState(Entity<SoundWhileAliveComponent> entity, ref MobStateChangedEvent args)
{

View File

@@ -12,6 +12,7 @@
- CanPilot
- BypassInteractionRangeChecks
- BypassDropChecks
- NoConsoleSound
- type: Input
context: "aghost"
- type: Ghost

View File

@@ -374,6 +374,7 @@
tags:
- HideContextMenu
- StationAi
- NoConsoleSound
# Hologram projection that the AI's eye tracks.
- type: entity

View File

@@ -62,6 +62,9 @@
volume: -1
variation: 0.10
pitch: 1.10 # low pitch keyboard sounds feel kinda weird
blacklist:
tags:
- NoConsoleSound
- type: ContainerContainer
containers:
board: !type:Container

View File

@@ -987,6 +987,9 @@
- type: Tag
id: NoBlockAnchoring
- type: Tag
id: NoConsoleSound
- type: Tag
id: NozzleBackTank