From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sun, 17 Sep 2023 17:57:49 +0000 (+1200) Subject: Fix light animations (#20263) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=53b4da68fad8a62e118fbe10825049406e19a376;p=space-station-14.git Fix light animations (#20263) --- diff --git a/Content.Client/Explosion/TriggerSystem.Proximity.cs b/Content.Client/Explosion/TriggerSystem.Proximity.cs index 41e4f914ff..d88bb4d449 100644 --- a/Content.Client/Explosion/TriggerSystem.Proximity.cs +++ b/Content.Client/Explosion/TriggerSystem.Proximity.cs @@ -30,7 +30,7 @@ public sealed partial class TriggerSystem { ComponentType = typeof(PointLightComponent), InterpolationMode = AnimationInterpolationMode.Nearest, - Property = nameof(PointLightComponent.Radius), + Property = nameof(PointLightComponent.AnimatedRadius), KeyFrames = { new AnimationTrackProperty.KeyFrame(0.1f, 0), diff --git a/Content.Client/Light/Components/LightBehaviourComponent.cs b/Content.Client/Light/Components/LightBehaviourComponent.cs index a89ddda108..b594411c35 100644 --- a/Content.Client/Light/Components/LightBehaviourComponent.cs +++ b/Content.Client/Light/Components/LightBehaviourComponent.cs @@ -24,7 +24,7 @@ namespace Content.Client.Light.Components [DataField("id")] public string ID { get; set; } = string.Empty; [DataField("property")] - public virtual string Property { get; protected set; } = "Radius"; + public virtual string Property { get; protected set; } = nameof(PointLightComponent.AnimatedRadius); [DataField("isLooped")] public bool IsLooped { get; set; } @@ -119,7 +119,7 @@ namespace Content.Client.Light.Components var playingTime = prevPlayingTime + frameTime; var interpolateValue = playingTime / MaxTime; - if (Property == "Enabled") // special case for boolean + if (Property == nameof(PointLightComponent.AnimatedEnable)) // special case for boolean { ApplyProperty(interpolateValue < 0.5f); return (-1, playingTime); @@ -181,7 +181,7 @@ namespace Content.Client.Light.Components var playingTime = prevPlayingTime + frameTime; var interpolateValue = playingTime / MaxTime; - if (Property == "Enabled") // special case for boolean + if (Property == nameof(PointLightComponent.AnimatedEnable)) // special case for boolean { ApplyProperty(interpolateValue < EndValue); return (-1, playingTime); @@ -245,7 +245,7 @@ namespace Content.Client.Light.Components public override void OnStart() { - if (Property == "Enabled") // special case for boolean, we randomize it + if (Property == nameof(PointLightComponent.AnimatedEnable)) // special case for boolean, we randomize it { ApplyProperty(_random.NextDouble() < 0.5); return; @@ -267,7 +267,7 @@ namespace Content.Client.Light.Components var playingTime = prevPlayingTime + frameTime; var interpolateValue = playingTime / MaxTime; - if (Property == "Enabled") + if (Property == nameof(PointLightComponent.AnimatedEnable)) { return (-1, playingTime); } @@ -298,7 +298,7 @@ namespace Content.Client.Light.Components public sealed partial class ColorCycleBehaviour : LightBehaviourAnimationTrack, ISerializationHooks { [DataField("property")] - public override string Property { get; protected set; } = "Color"; + public override string Property { get; protected set; } = nameof(PointLightComponent.Color); [DataField("colors")] public List ColorsToCycle { get; set; } = new(); diff --git a/Content.Client/Light/Visualizers/PoweredLightVisualizerSystem.cs b/Content.Client/Light/Visualizers/PoweredLightVisualizerSystem.cs index 62af358c40..bf69053d9a 100644 --- a/Content.Client/Light/Visualizers/PoweredLightVisualizerSystem.cs +++ b/Content.Client/Light/Visualizers/PoweredLightVisualizerSystem.cs @@ -89,7 +89,7 @@ public sealed class PoweredLightVisualizerSystem : VisualizerSystem