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