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;
|
using Robust.Shared.GameStates;
|
||||||
|
|
||||||
namespace Content.Shared.Sound.Components;
|
namespace Content.Shared.Sound.Components;
|
||||||
@@ -8,4 +9,9 @@ namespace Content.Shared.Sound.Components;
|
|||||||
[RegisterComponent, NetworkedComponent]
|
[RegisterComponent, NetworkedComponent]
|
||||||
public sealed partial class EmitSoundOnUIOpenComponent : BaseEmitSoundComponent
|
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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,10 @@ public abstract class SharedEmitSoundSystem : EntitySystem
|
|||||||
|
|
||||||
private void HandleEmitSoundOnUIOpen(EntityUid uid, EmitSoundOnUIOpenComponent component, AfterActivatableUIOpenEvent args)
|
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<SoundWhileAliveComponent> entity, ref MobStateChangedEvent args)
|
private void OnMobState(Entity<SoundWhileAliveComponent> entity, ref MobStateChangedEvent args)
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
- CanPilot
|
- CanPilot
|
||||||
- BypassInteractionRangeChecks
|
- BypassInteractionRangeChecks
|
||||||
- BypassDropChecks
|
- BypassDropChecks
|
||||||
|
- NoConsoleSound
|
||||||
- type: Input
|
- type: Input
|
||||||
context: "aghost"
|
context: "aghost"
|
||||||
- type: Ghost
|
- type: Ghost
|
||||||
|
|||||||
@@ -374,6 +374,7 @@
|
|||||||
tags:
|
tags:
|
||||||
- HideContextMenu
|
- HideContextMenu
|
||||||
- StationAi
|
- StationAi
|
||||||
|
- NoConsoleSound
|
||||||
|
|
||||||
# Hologram projection that the AI's eye tracks.
|
# Hologram projection that the AI's eye tracks.
|
||||||
- type: entity
|
- type: entity
|
||||||
|
|||||||
@@ -62,6 +62,9 @@
|
|||||||
volume: -1
|
volume: -1
|
||||||
variation: 0.10
|
variation: 0.10
|
||||||
pitch: 1.10 # low pitch keyboard sounds feel kinda weird
|
pitch: 1.10 # low pitch keyboard sounds feel kinda weird
|
||||||
|
blacklist:
|
||||||
|
tags:
|
||||||
|
- NoConsoleSound
|
||||||
- type: ContainerContainer
|
- type: ContainerContainer
|
||||||
containers:
|
containers:
|
||||||
board: !type:Container
|
board: !type:Container
|
||||||
|
|||||||
@@ -987,6 +987,9 @@
|
|||||||
- type: Tag
|
- type: Tag
|
||||||
id: NoBlockAnchoring
|
id: NoBlockAnchoring
|
||||||
|
|
||||||
|
- type: Tag
|
||||||
|
id: NoConsoleSound
|
||||||
|
|
||||||
- type: Tag
|
- type: Tag
|
||||||
id: NozzleBackTank
|
id: NozzleBackTank
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user