diff --git a/Content.Shared/Sound/Components/EmitSoundOnUIOpenComponent.cs b/Content.Shared/Sound/Components/EmitSoundOnUIOpenComponent.cs index a979a6ec50..65848cb5e5 100644 --- a/Content.Shared/Sound/Components/EmitSoundOnUIOpenComponent.cs +++ b/Content.Shared/Sound/Components/EmitSoundOnUIOpenComponent.cs @@ -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 { + /// + /// Blacklist for making the sound not play if certain entities open the UI + /// + [DataField] + public EntityWhitelist Blacklist = new(); } diff --git a/Content.Shared/Sound/SharedEmitSoundSystem.cs b/Content.Shared/Sound/SharedEmitSoundSystem.cs index 8040910dc3..3e051fff31 100644 --- a/Content.Shared/Sound/SharedEmitSoundSystem.cs +++ b/Content.Shared/Sound/SharedEmitSoundSystem.cs @@ -58,7 +58,10 @@ public abstract class SharedEmitSoundSystem : EntitySystem private void HandleEmitSoundOnUIOpen(EntityUid uid, EmitSoundOnUIOpenComponent component, AfterActivatableUIOpenEvent args) { - TryEmitSound(uid, component, args.User); + if (_whitelistSystem.IsBlacklistFail(component.Blacklist, args.User)) + { + TryEmitSound(uid, component, args.User); + } } private void OnMobState(Entity entity, ref MobStateChangedEvent args) diff --git a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml index 0f1c77e262..1c3862e99a 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml @@ -12,6 +12,7 @@ - CanPilot - BypassInteractionRangeChecks - BypassDropChecks + - NoConsoleSound - type: Input context: "aghost" - type: Ghost diff --git a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml index 9c906bd1a1..c9164b14d1 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml @@ -374,6 +374,7 @@ tags: - HideContextMenu - StationAi + - NoConsoleSound # Hologram projection that the AI's eye tracks. - type: entity diff --git a/Resources/Prototypes/Entities/Structures/Machines/Computers/base_structurecomputers.yml b/Resources/Prototypes/Entities/Structures/Machines/Computers/base_structurecomputers.yml index e961cf94d3..d79348bfa6 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/Computers/base_structurecomputers.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/Computers/base_structurecomputers.yml @@ -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 diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index 4f9d0eb3f8..d3ffcdcac1 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -987,6 +987,9 @@ - type: Tag id: NoBlockAnchoring +- type: Tag + id: NoConsoleSound + - type: Tag id: NozzleBackTank