Skip to content

Commit b5687e4

Browse files
authored
prevent typing sound from playing when AI interacts with consoles (space-wizards#32906)
* prevent typing sound from playing when AI interacts with consoles * cleanup
1 parent 1d2ad3c commit b5687e4

File tree

6 files changed

+18
-1
lines changed

6 files changed

+18
-1
lines changed

‎Content.Shared/Sound/Components/EmitSoundOnUIOpenComponent.cs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Content.Shared.Whitelist;
12
using Robust.Shared.GameStates;
23

34
namespace Content.Shared.Sound.Components;
@@ -8,4 +9,9 @@ namespace Content.Shared.Sound.Components;
89
[RegisterComponent, NetworkedComponent]
910
public sealed partial class EmitSoundOnUIOpenComponent : BaseEmitSoundComponent
1011
{
12+
/// <summary>
13+
/// Blacklist for making the sound not play if certain entities open the UI
14+
/// </summary>
15+
[DataField]
16+
public EntityWhitelist Blacklist = new();
1117
}

‎Content.Shared/Sound/SharedEmitSoundSystem.cs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ public override void Initialize()
5858

5959
private void HandleEmitSoundOnUIOpen(EntityUid uid, EmitSoundOnUIOpenComponent component, AfterActivatableUIOpenEvent args)
6060
{
61-
TryEmitSound(uid, component, args.User);
61+
if (_whitelistSystem.IsBlacklistFail(component.Blacklist, args.User))
62+
{
63+
TryEmitSound(uid, component, args.User);
64+
}
6265
}
6366

6467
private void OnMobState(Entity<SoundWhileAliveComponent> entity, ref MobStateChangedEvent args)

‎Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- CanPilot
1313
- BypassInteractionRangeChecks
1414
- BypassDropChecks
15+
- NoConsoleSound
1516
- type: Input
1617
context: "aghost"
1718
- type: Ghost

‎Resources/Prototypes/Entities/Mobs/Player/silicon.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@
374374
tags:
375375
- HideContextMenu
376376
- StationAi
377+
- NoConsoleSound
377378

378379
# Hologram projection that the AI's eye tracks.
379380
- type: entity

‎Resources/Prototypes/Entities/Structures/Machines/Computers/base_structurecomputers.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
volume: -1
6363
variation: 0.10
6464
pitch: 1.10 # low pitch keyboard sounds feel kinda weird
65+
blacklist:
66+
tags:
67+
- NoConsoleSound
6568
- type: ContainerContainer
6669
containers:
6770
board: !type:Container

‎Resources/Prototypes/tags.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,9 @@
987987
- type: Tag
988988
id: NoBlockAnchoring
989989

990+
- type: Tag
991+
id: NoConsoleSound
992+
990993
- type: Tag
991994
id: NozzleBackTank
992995

0 commit comments

Comments
 (0)