Remove lights compref (#19531)
This commit is contained in:
@@ -10,6 +10,8 @@ namespace Content.Client.Atmos.EntitySystems;
|
||||
/// </summary>
|
||||
public sealed class FireVisualizerSystem : VisualizerSystem<FireVisualsComponent>
|
||||
{
|
||||
[Dependency] private readonly PointLightSystem _lights = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -83,11 +85,11 @@ public sealed class FireVisualizerSystem : VisualizerSystem<FireVisualsComponent
|
||||
component.LightEntity ??= Spawn(null, new EntityCoordinates(uid, default));
|
||||
var light = EnsureComp<PointLightComponent>(component.LightEntity.Value);
|
||||
|
||||
light.Color = component.LightColor;
|
||||
_lights.SetColor(component.LightEntity.Value, component.LightColor, light);
|
||||
|
||||
// light needs a minimum radius to be visible at all, hence the + 1.5f
|
||||
light.Radius = Math.Clamp(1.5f + component.LightRadiusPerStack * fireStacks, 0f, component.MaxLightRadius);
|
||||
light.Energy = Math.Clamp(1 + component.LightEnergyPerStack * fireStacks, 0f, component.MaxLightEnergy);
|
||||
_lights.SetRadius(component.LightEntity.Value, Math.Clamp(1.5f + component.LightRadiusPerStack * fireStacks, 0f, component.MaxLightRadius), light);
|
||||
_lights.SetEnergy(component.LightEntity.Value, Math.Clamp(1 + component.LightEnergyPerStack * fireStacks, 0f, component.MaxLightEnergy), light);
|
||||
|
||||
// TODO flickering animation? Or just add a noise mask to the light? But that requires an engine PR.
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.Graphics;
|
||||
using Robust.Shared.Graphics.RSI;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
@@ -79,7 +81,7 @@ namespace Content.Client.Atmos.Overlays
|
||||
|
||||
if (!rsi.TryGetState(stateId, out var state)) continue;
|
||||
|
||||
_frames[i] = state.GetFrames(RSI.State.Direction.South);
|
||||
_frames[i] = state.GetFrames(RsiDirection.South);
|
||||
_frameDelays[i] = state.GetDelays();
|
||||
_frameCounter[i] = 0;
|
||||
break;
|
||||
@@ -97,7 +99,7 @@ namespace Content.Client.Atmos.Overlays
|
||||
if (!fire.TryGetState((i + 1).ToString(), out var state))
|
||||
throw new ArgumentOutOfRangeException($"Fire RSI doesn't have state \"{i}\"!");
|
||||
|
||||
_fireFrames[i] = state.GetFrames(RSI.State.Direction.South);
|
||||
_fireFrames[i] = state.GetFrames(RsiDirection.South);
|
||||
_fireFrameDelays[i] = state.GetDelays();
|
||||
_fireFrameCounter[i] = 0;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using static Content.Shared.Atmos.Components.GasAnalyzerComponent;
|
||||
using Direction = Robust.Shared.Maths.Direction;
|
||||
|
||||
namespace Content.Client.Atmos.UI
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user