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:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
- CanPilot
|
||||
- BypassInteractionRangeChecks
|
||||
- BypassDropChecks
|
||||
- NoConsoleSound
|
||||
- type: Input
|
||||
context: "aghost"
|
||||
- type: Ghost
|
||||
|
||||
@@ -374,6 +374,7 @@
|
||||
tags:
|
||||
- HideContextMenu
|
||||
- StationAi
|
||||
- NoConsoleSound
|
||||
|
||||
# Hologram projection that the AI's eye tracks.
|
||||
- type: entity
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -987,6 +987,9 @@
|
||||
- type: Tag
|
||||
id: NoBlockAnchoring
|
||||
|
||||
- type: Tag
|
||||
id: NoConsoleSound
|
||||
|
||||
- type: Tag
|
||||
id: NozzleBackTank
|
||||
|
||||
|
||||
Reference in New Issue
Block a user