Fix 3000 errors
This commit is contained in:
@@ -51,9 +51,9 @@ namespace Content.Client.Light.Components
|
||||
[ViewVariables] protected float MaxTime { get; set; }
|
||||
|
||||
private float _maxTime = default;
|
||||
private IEntity _parent = default!;
|
||||
private EntityUid _parent = default!;
|
||||
|
||||
public void Initialize(IEntity parent, IRobustRandom random)
|
||||
public void Initialize(EntityUid parent, IRobustRandom random)
|
||||
{
|
||||
_random = random;
|
||||
_parent = parent;
|
||||
@@ -128,7 +128,7 @@ namespace Content.Client.Light.Components
|
||||
|
||||
if (Property == "Enabled") // special case for boolean
|
||||
{
|
||||
ApplyProperty(interpolateValue < 0.5f? true : false);
|
||||
ApplyProperty(interpolateValue < 0.5f);
|
||||
return (-1, playingTime);
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace Content.Client.Light.Components
|
||||
|
||||
if (Property == "Enabled") // special case for boolean
|
||||
{
|
||||
ApplyProperty(interpolateValue < EndValue? true : false);
|
||||
ApplyProperty(interpolateValue < EndValue);
|
||||
return (-1, playingTime);
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ namespace Content.Client.Light.Components
|
||||
ApplyProperty(InterpolateLinear(_randomValue3, _randomValue4, interpolateValue));
|
||||
break;
|
||||
case AnimationInterpolationMode.Cubic:
|
||||
ApplyProperty(InterpolateCubic(_randomValue1!, _randomValue2, _randomValue3, _randomValue4, interpolateValue));
|
||||
ApplyProperty(InterpolateCubic(_randomValue1, _randomValue2, _randomValue3, _randomValue4, interpolateValue));
|
||||
break;
|
||||
default:
|
||||
case AnimationInterpolationMode.Nearest:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Content.Shared.Light.Component;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Client.Light.Visualizers
|
||||
@@ -12,7 +13,8 @@ namespace Content.Client.Light.Visualizers
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
|
||||
if (!component.Owner.TryGetComponent(out SpriteComponent? sprite))
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
if (!entities.TryGetComponent(component.Owner, out SpriteComponent? sprite))
|
||||
return;
|
||||
|
||||
if (!component.TryGetData(EmergencyLightVisuals.On, out bool on))
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using Content.Client.Light.Components;
|
||||
using Content.Client.Light.Components;
|
||||
using Content.Shared.Light.Component;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Client.Light.Visualizers
|
||||
@@ -16,9 +16,10 @@ namespace Content.Client.Light.Visualizers
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
if (component.TryGetData(ExpendableLightVisuals.Behavior, out string lightBehaviourID))
|
||||
{
|
||||
if (component.Owner.TryGetComponent<LightBehaviourComponent>(out var lightBehaviour))
|
||||
if (entities.TryGetComponent(component.Owner, out LightBehaviourComponent lightBehaviour))
|
||||
{
|
||||
lightBehaviour.StopLightBehaviour();
|
||||
|
||||
@@ -26,7 +27,7 @@ namespace Content.Client.Light.Visualizers
|
||||
{
|
||||
lightBehaviour.StartLightBehaviour(lightBehaviourID);
|
||||
}
|
||||
else if (component.Owner.TryGetComponent<PointLightComponent>(out var light))
|
||||
else if (entities.TryGetComponent(component.Owner, out PointLightComponent light))
|
||||
{
|
||||
light.Enabled = false;
|
||||
}
|
||||
@@ -39,7 +40,7 @@ namespace Content.Client.Light.Visualizers
|
||||
}
|
||||
|
||||
if (component.TryGetData(ExpendableLightVisuals.State, out ExpendableLightState state)
|
||||
&& component.Owner.TryGetComponent<ExpendableLightComponent>(out var expendableLight))
|
||||
&& entities.TryGetComponent(component.Owner, out ExpendableLightComponent expendableLight))
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@ using Content.Shared.Light;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Maths;
|
||||
|
||||
namespace Content.Client.Light.Visualizers
|
||||
@@ -13,7 +14,8 @@ namespace Content.Client.Light.Visualizers
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
|
||||
if (!component.Owner.TryGetComponent<SpriteComponent>(out var sprite))
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
if (!entities.TryGetComponent(component.Owner, out SpriteComponent sprite))
|
||||
return;
|
||||
|
||||
// update sprite state
|
||||
|
||||
@@ -7,7 +7,6 @@ using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Animations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
@@ -28,7 +27,8 @@ namespace Content.Client.Light.Visualizers
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
|
||||
if (!component.Owner.TryGetComponent(out ISpriteComponent? sprite)) return;
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
if (!entities.TryGetComponent(component.Owner, out ISpriteComponent? sprite)) return;
|
||||
if (!component.TryGetData(PoweredLightVisuals.BulbState, out PoweredLightState state)) return;
|
||||
|
||||
switch (state)
|
||||
|
||||
Reference in New Issue
Block a user