Lights now use dependencies.
This commit is contained in:
@@ -31,6 +31,8 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece
|
||||
[RegisterComponent]
|
||||
public class PoweredLightComponent : Component, IInteractHand, IInteractUsing, IMapInit, ISignalReceiver
|
||||
{
|
||||
[Dependency] private IGameTiming _gameTiming = default!;
|
||||
|
||||
public override string Name => "PoweredLight";
|
||||
|
||||
private static readonly TimeSpan _thunkDelay = TimeSpan.FromSeconds(2);
|
||||
@@ -40,6 +42,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece
|
||||
|
||||
private LightBulbType BulbType = LightBulbType.Tube;
|
||||
[ViewVariables] private ContainerSlot _lightBulbContainer;
|
||||
|
||||
[ViewVariables]
|
||||
private LightBulbComponent LightBulb
|
||||
{
|
||||
@@ -209,7 +212,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece
|
||||
sprite.LayerSetState(0, "on");
|
||||
light.Enabled = true;
|
||||
light.Color = LightBulb.Color;
|
||||
var time = IoCManager.Resolve<IGameTiming>().CurTime;
|
||||
var time = _gameTiming.CurTime;
|
||||
if (time > _lastThunk + _thunkDelay)
|
||||
{
|
||||
_lastThunk = time;
|
||||
|
||||
Reference in New Issue
Block a user