mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 13:37:47 +03:00
will do map refactor tomorrow, for now, planet lighting 🆑 * add: Ported planet lighting for indoor / outdoor areas. * add: Ported day-night cycle functionality. * add: Ported some Storage UI v2 fixes. --------- Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: DoutorWhite <thedoctorwhite@gmail.com> Co-authored-by: Janet Blackquill <uhhadd@gmail.com> (cherry picked from commit 4efb0b3b328dd4eba3095cc3f0a95fad88b49661)
23 lines
589 B
C#
23 lines
589 B
C#
using Content.Shared;
|
|
using Content.Shared.Light.Components;
|
|
using Robust.Shared.Random;
|
|
|
|
namespace Content.Server.Light.EntitySystems;
|
|
|
|
/// <inheritdoc/>
|
|
public sealed class LightCycleSystem : SharedLightCycleSystem
|
|
{
|
|
[Dependency] private readonly IRobustRandom _random = default!;
|
|
|
|
protected override void OnCycleMapInit(Entity<LightCycleComponent> ent, ref MapInitEvent args)
|
|
{
|
|
base.OnCycleMapInit(ent, ref args);
|
|
|
|
if (ent.Comp.InitialOffset)
|
|
{
|
|
ent.Comp.Offset = _random.Next(ent.Comp.Duration);
|
|
Dirty(ent);
|
|
}
|
|
}
|
|
}
|