Glowsticks, flares and lighting behaviours (#1886)
* Assets * LightingBehaviours, flares, and such. * More changes * More changes, more flare work. * More work on flares + light behaviours * another refactor * missed * Light behaviours refactor, added sfx, improved graphics, improved lighting effects for glowstick and flare. * remove unneeded value * nullables * remove old code * nullable * one last push * net id * more work * more colors for glowsticks * Adjust flare so it fades in * fix name * sprite fix
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
|
||||
using Content.Shared.GameObjects.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using System;
|
||||
|
||||
namespace Content.Client.GameObjects.Components
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class ExpendableLightVisualizer : AppearanceVisualizer
|
||||
{
|
||||
public override void OnChangeData(AppearanceComponent component)
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
|
||||
if (component.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (component.TryGetData(ExpendableLightVisuals.State, out string lightBehaviourID))
|
||||
{
|
||||
if (component.Owner.TryGetComponent<LightBehaviourComponent>(out var lightBehaviour))
|
||||
{
|
||||
lightBehaviour.StopLightBehaviour();
|
||||
|
||||
if (lightBehaviourID != string.Empty)
|
||||
{
|
||||
lightBehaviour.StartLightBehaviour(lightBehaviourID);
|
||||
}
|
||||
else if (component.Owner.TryGetComponent<PointLightComponent>(out var light))
|
||||
{
|
||||
light.Enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user