pda improvements (#1072)

Co-authored-by: FL-OZ <anotherscuffed@gmail.com>
This commit is contained in:
FL-OZ
2020-06-05 11:44:25 -05:00
committed by GitHub
parent 19c9e3e4f9
commit fa9169e346
10 changed files with 188 additions and 62 deletions

View File

@@ -1,11 +1,32 @@
using Content.Shared.GameObjects.Components.PDA;
using Robust.Client.GameObjects.EntitySystems;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.Players;
namespace Content.Client.GameObjects.Components.PDA
{
[RegisterComponent]
public class PDAComponent : SharedPDAComponent
{
public override void HandleNetworkMessage(ComponentMessage message, INetChannel netChannel, ICommonSession session = null)
{
base.HandleNetworkMessage(message, netChannel, session);
switch(message)
{
case PDAUplinkBuySuccessMessage _ :
EntitySystem.Get<AudioSystem>().Play("/Audio/effects/kaching.ogg", Owner, AudioParams.Default.WithVolume(-2f));
break;
case PDAUplinkInsufficientFundsMessage _ :
EntitySystem.Get<AudioSystem>().Play("/Audio/effects/error.ogg", Owner, AudioParams.Default);
break;
}
}
}
}