Opening lockers or crates makes sound now.

This commit is contained in:
Pieter-Jan Briers
2019-07-27 09:23:00 +02:00
parent aea7d01eaa
commit 2e230c089b
5 changed files with 13 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
using System.Linq; using System.Linq;
using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.Components.Sound;
using Content.Shared.GameObjects.Components.Storage; using Content.Shared.GameObjects.Components.Storage;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
@@ -70,7 +71,12 @@ namespace Content.Server.GameObjects.Components
break; break;
} }
} }
ModifyComponents(); ModifyComponents();
if (Owner.TryGetComponent(out SoundComponent soundComponent))
{
soundComponent.Play("/Audio/machines/closetclose.ogg");
}
} }
private void OpenStorage() private void OpenStorage()
@@ -78,6 +84,10 @@ namespace Content.Server.GameObjects.Components
Open = true; Open = true;
EmptyContents(); EmptyContents();
ModifyComponents(); ModifyComponents();
if (Owner.TryGetComponent(out SoundComponent soundComponent))
{
soundComponent.Play("/Audio/machines/closetopen.ogg");
}
} }
private void ModifyComponents() private void ModifyComponents()

Binary file not shown.

Binary file not shown.

View File

@@ -34,6 +34,7 @@
- type: StorageVisualizer2D - type: StorageVisualizer2D
state_open: generic_open state_open: generic_open
state_closed: generic_door state_closed: generic_door
- type: Sound
placement: placement:
snap: snap:

View File

@@ -38,3 +38,4 @@
state_open: crate_open state_open: crate_open
state_closed: crate_door state_closed: crate_door
- type: Sound