Remove lights compref (#19531)
This commit is contained in:
@@ -6,6 +6,8 @@ namespace Content.Client.Power.APC;
|
||||
|
||||
public sealed class ApcVisualizerSystem : VisualizerSystem<ApcVisualsComponent>
|
||||
{
|
||||
[Dependency] private readonly SharedPointLightSystem _lights = default!;
|
||||
|
||||
protected override void OnAppearanceChange(EntityUid uid, ApcVisualsComponent comp, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (args.Sprite == null)
|
||||
@@ -43,8 +45,10 @@ public sealed class ApcVisualizerSystem : VisualizerSystem<ApcVisualsComponent>
|
||||
}
|
||||
}
|
||||
|
||||
if (TryComp<SharedPointLightComponent>(uid, out var light))
|
||||
light.Color = comp.ScreenColors[(sbyte)chargeState];
|
||||
if (TryComp<PointLightComponent>(uid, out var light))
|
||||
{
|
||||
_lights.SetColor(uid, comp.ScreenColors[(sbyte)chargeState], light);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -61,8 +65,10 @@ public sealed class ApcVisualizerSystem : VisualizerSystem<ApcVisualsComponent>
|
||||
args.Sprite.LayerSetVisible(layer, false);
|
||||
}
|
||||
|
||||
if (TryComp<SharedPointLightComponent>(uid, out var light))
|
||||
light.Color = comp.EmaggedScreenColor;
|
||||
if (TryComp<PointLightComponent>(uid, out var light))
|
||||
{
|
||||
_lights.SetColor(uid, comp.EmaggedScreenColor, light);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Graphics;
|
||||
using Robust.Shared.Graphics.RSI;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Power;
|
||||
@@ -64,7 +66,7 @@ public sealed partial class PowerMonitoringWindow : DefaultWindow, IComputerWind
|
||||
IRsiStateLike? iconState = null;
|
||||
if (entityPrototype != null)
|
||||
iconState = _spriteSystem.GetPrototypeIcon(entityPrototype);
|
||||
var icon = iconState?.GetFrame(RSI.State.Direction.South, 0);
|
||||
var icon = iconState?.GetFrame(RsiDirection.South, 0);
|
||||
var item = list[i];
|
||||
item.Text = $"{ent.NameLocalized} {Loc.GetString("power-monitoring-window-value", ("value", ent.Size))}";
|
||||
item.Icon = icon;
|
||||
|
||||
Reference in New Issue
Block a user