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 System.Linq;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.Components.Sound;
using Content.Shared.GameObjects.Components.Storage;
using Robust.Server.GameObjects;
@@ -70,7 +71,12 @@ namespace Content.Server.GameObjects.Components
break;
}
}
ModifyComponents();
if (Owner.TryGetComponent(out SoundComponent soundComponent))
{
soundComponent.Play("/Audio/machines/closetclose.ogg");
}
}
private void OpenStorage()
@@ -78,10 +84,14 @@ namespace Content.Server.GameObjects.Components
Open = true;
EmptyContents();
ModifyComponents();
if (Owner.TryGetComponent(out SoundComponent soundComponent))
{
soundComponent.Play("/Audio/machines/closetopen.ogg");
}
}
private void ModifyComponents()
{
{
if (Owner.TryGetComponent<ICollidableComponent>(out var collidableComponent))
{
collidableComponent.CollisionEnabled = IsCollidableWhenOpen || !Open;

Binary file not shown.

Binary file not shown.

View File

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

View File

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