light refactoring/rework (#19314)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-09-04 06:31:10 +01:00
committed by GitHub
parent 4e51fd4fff
commit 91cfabd6f6
44 changed files with 581 additions and 584 deletions

View File

@@ -0,0 +1,24 @@
using Content.Shared.Light;
using Content.Shared.Light.Components;
using Robust.Shared.GameObjects;
namespace Content.Server.Light.EntitySystems;
public sealed class RotatingLightSystem : SharedRotatingLightSystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<RotatingLightComponent, PointLightToggleEvent>(OnLightToggle);
}
private void OnLightToggle(EntityUid uid, RotatingLightComponent comp, PointLightToggleEvent args)
{
if (comp.Enabled == args.Enabled)
return;
comp.Enabled = args.Enabled;
Dirty(comp);
}
}