Aurora Australis (#12356)

This commit is contained in:
metalgearsloth
2022-11-24 18:31:17 +11:00
committed by GitHub
parent 5a6f30fb74
commit 80bb8e3bf6
3 changed files with 12 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ using Content.Shared.Light;
using Content.Shared.Light.Component;
using Robust.Client.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Map.Components;
using Robust.Shared.Timing;
using static Robust.Client.GameObjects.SpriteComponent;
@@ -14,8 +15,8 @@ namespace Content.Client.Light
{
public sealed class RgbLightControllerSystem : SharedRgbLightControllerSystem
{
[Dependency] private IGameTiming _gameTiming = default!;
[Dependency] private ItemSystem _itemSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly ItemSystem _itemSystem = default!;
public override void Initialize()
{
@@ -190,6 +191,12 @@ namespace Content.Client.Light
holderSprite.LayerSetColor(layer, color);
}
}
foreach (var (rgb, map) in EntityQuery<RgbLightControllerComponent, MapLightComponent>())
{
var color = GetCurrentRgbColor(_gameTiming.RealTime, rgb.CreationTick.Value * _gameTiming.TickPeriod, rgb);
map.AmbientLightColor = color;
}
}
public static Color GetCurrentRgbColor(TimeSpan curTime, TimeSpan offset, RgbLightControllerComponent rgb)