Skip to content

Commit

Permalink
sound tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
pheenty committed Oct 21, 2024
1 parent eaf3493 commit 46f931a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions Content.Server/Stories/Nightvision/NightvisionSystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Content.Shared.Actions;
using Content.Shared.GameTicking;
using Content.Shared.Inventory.Events;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
using Robust.Shared.Timing;
using Content.Shared.Stories.Nightvision;
Expand All @@ -12,7 +11,6 @@ public sealed class NightvisionSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
public override void Initialize()
{
base.Initialize();
Expand All @@ -36,8 +34,6 @@ private void OnEquipped(EntityUid uid, NightvisionClothingComponent component, G
}
private void OnStartUp(EntityUid uid, NightvisionComponent component, ComponentStartup args)
{
if (component.PlaySound)
_audio.PlayPvs(component.ToggleOnSound, uid);
_actions.AddAction(uid, ref component.ToggleActionEntity, component.ToggleAction);
}
private void OnShutdown(EntityUid uid, NightvisionComponent component, ComponentShutdown args)
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Stories/Nightvision/NightvisionComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Content.Shared.Stories.Nightvision;
public sealed partial class NightvisionComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField("enabled"), AutoNetworkedField]
public bool Enabled { get; set; } = true;
public bool Enabled { get; set; } = false;
[DataField]
public string ToggleAction = "ToggleNightvisionAction";
[DataField, AutoNetworkedField]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ private void OnToggle(EntityUid uid, NightvisionComponent component, ToggleNight
return;
component.Enabled = !component.Enabled;
if (component.Enabled && component.PlaySound)
_audio.PlayPredicted(component.ToggleOnSound, uid, uid);
_audio.PlayLocal(component.ToggleOnSound, uid, uid);
}
}

0 comments on commit 46f931a

Please sign in to comment.