APCs now go click when breaker is switched.
This commit is contained in:
parent
a7e63329b4
commit
34f4c12e00
|
|
@ -2,9 +2,12 @@
|
|||
using Content.Shared.GameObjects.Components.Power;
|
||||
using SS14.Server.GameObjects;
|
||||
using SS14.Server.GameObjects.Components.UserInterface;
|
||||
using SS14.Server.GameObjects.EntitySystems;
|
||||
using SS14.Server.Interfaces.GameObjects;
|
||||
using SS14.Shared.Audio;
|
||||
using SS14.Shared.GameObjects.Components.UserInterface;
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
using SS14.Shared.IoC;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Power
|
||||
{
|
||||
|
|
@ -36,6 +39,7 @@ namespace Content.Server.GameObjects.Components.Power
|
|||
{
|
||||
_provider.MainBreaker = !_provider.MainBreaker;
|
||||
_uiDirty = true;
|
||||
_clickSound();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -64,7 +68,8 @@ namespace Content.Server.GameObjects.Components.Power
|
|||
|
||||
if (_uiDirty)
|
||||
{
|
||||
_userInterface.SetState(new ApcBoundInterfaceState(_provider.MainBreaker, extPowerState, newCharge / Storage.Capacity));
|
||||
_userInterface.SetState(new ApcBoundInterfaceState(_provider.MainBreaker, extPowerState,
|
||||
newCharge / Storage.Capacity));
|
||||
_uiDirty = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -110,5 +115,11 @@ namespace Content.Server.GameObjects.Components.Power
|
|||
_userInterface.Open(actor.playerSession);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void _clickSound()
|
||||
{
|
||||
IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<AudioSystem>()
|
||||
.Play("/Audio/machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue