Aurora Australis (#12356)
This commit is contained in:
@@ -7,6 +7,7 @@ using Content.Shared.Light;
|
|||||||
using Content.Shared.Light.Component;
|
using Content.Shared.Light.Component;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
|
using Robust.Shared.Map.Components;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using static Robust.Client.GameObjects.SpriteComponent;
|
using static Robust.Client.GameObjects.SpriteComponent;
|
||||||
|
|
||||||
@@ -14,8 +15,8 @@ namespace Content.Client.Light
|
|||||||
{
|
{
|
||||||
public sealed class RgbLightControllerSystem : SharedRgbLightControllerSystem
|
public sealed class RgbLightControllerSystem : SharedRgbLightControllerSystem
|
||||||
{
|
{
|
||||||
[Dependency] private IGameTiming _gameTiming = default!;
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||||
[Dependency] private ItemSystem _itemSystem = default!;
|
[Dependency] private readonly ItemSystem _itemSystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -190,6 +191,12 @@ namespace Content.Client.Light
|
|||||||
holderSprite.LayerSetColor(layer, color);
|
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)
|
public static Color GetCurrentRgbColor(TimeSpan curTime, TimeSpan offset, RgbLightControllerComponent rgb)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public abstract class SharedRgbLightControllerSystem : EntitySystem
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
rgb.Layers = layers;
|
rgb.Layers = layers;
|
||||||
rgb.Dirty();
|
Dirty(rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetCycleRate(EntityUid uid, float rate, RgbLightControllerComponent? rgb = null)
|
public void SetCycleRate(EntityUid uid, float rate, RgbLightControllerComponent? rgb = null)
|
||||||
@@ -32,6 +32,6 @@ public abstract class SharedRgbLightControllerSystem : EntitySystem
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
rgb.CycleRate = Math.Clamp(0.01f, rate, 1); // lets not give people seizures
|
rgb.CycleRate = Math.Clamp(0.01f, rate, 1); // lets not give people seizures
|
||||||
rgb.Dirty();
|
Dirty(rgb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,7 @@
|
|||||||
- mapinit
|
- mapinit
|
||||||
- savegrid
|
- savegrid
|
||||||
- savemap
|
- savemap
|
||||||
|
- setambientlight
|
||||||
- tpgrid
|
- tpgrid
|
||||||
- gridtc
|
- gridtc
|
||||||
- togglespritenetsync
|
- togglespritenetsync
|
||||||
|
|||||||
Reference in New Issue
Block a user