Files
OldThink/Content.Client/_White/Lighting/Shaders/TogglingLightOverlaySystem.cs
ThereDrD aedaf4fc25 Шейдеры на лампочки (#655)
* +light shader

* fixed

* toggling logic

* nice

* add option to settings

---------

Co-authored-by: CaYpeN1 <artem7771art@gmail.com>
2024-08-22 05:08:56 +03:00

22 lines
656 B
C#

using Content.Shared._White.Lighting.Shaders;
using Content.Shared.Power;
using Robust.Client.GameObjects;
namespace Content.Client._White.Lighting.Shaders;
public sealed class TogglingLightOverlaySystem : EntitySystem
{
public override void Initialize()
{
SubscribeLocalEvent<LightingOverlayComponent, AppearanceChangeEvent>(OnAppearanceChange);
}
private void OnAppearanceChange(EntityUid uid, LightingOverlayComponent component, AppearanceChangeEvent args)
{
if (!args.AppearanceData.TryGetValue(PowerDeviceVisuals.Powered, out var state))
return;
component.Enabled = (bool) state;
}
}