From ddbd69dc678fa10fe237186fc2a6aeaa352a80b7 Mon Sep 17 00:00:00 2001 From: Alden Wu Date: Tue, 20 Sep 2022 09:44:01 -0700 Subject: [PATCH] Replace LifetimeAfterSmokeEnd with abstract LifetimeEnd --- osu.Game.Rulesets.Osu/Skinning/Default/DefaultSmoke.cs | 2 +- osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySmoke.cs | 4 ++-- osu.Game.Rulesets.Osu/Skinning/Smoke.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSmoke.cs b/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSmoke.cs index a3c5733eb4..65ae490882 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSmoke.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSmoke.cs @@ -15,7 +15,7 @@ public class DefaultSmoke : Smoke private const double fade_out_duration = 50; private const float alpha = 0.5f; - protected override double LifetimeAfterSmokeEnd => fade_out_delay + fade_out_duration + (SmokeEndTime - SmokeStartTime) / fade_out_speed; + public override double LifetimeEnd => SmokeEndTime + fade_out_delay + fade_out_duration + (SmokeEndTime - SmokeStartTime) / fade_out_speed; public DefaultSmoke() { diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySmoke.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySmoke.cs index 556996895c..f02c20fefb 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySmoke.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySmoke.cs @@ -37,12 +37,12 @@ public class LegacySmoke : Smoke protected int RotationSeed { get; set; } = RNG.Next(); - protected override double LifetimeAfterSmokeEnd + public override double LifetimeEnd { get { double initialFadeOutDurationTrunc = Math.Min(initial_fade_out_duration, SmokeEndTime - SmokeStartTime); - return final_fade_out_duration + initialFadeOutDurationTrunc / re_fade_in_speed + initialFadeOutDurationTrunc / final_fade_out_speed; + return SmokeEndTime + final_fade_out_duration + initialFadeOutDurationTrunc / re_fade_in_speed + initialFadeOutDurationTrunc / final_fade_out_speed; } } diff --git a/osu.Game.Rulesets.Osu/Skinning/Smoke.cs b/osu.Game.Rulesets.Osu/Skinning/Smoke.cs index 3afcc031a5..c381b543b3 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Smoke.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Smoke.cs @@ -69,7 +69,6 @@ protected Vector2 BottomRight } } - protected abstract double LifetimeAfterSmokeEnd { get; } protected virtual float PointInterval => Radius * 7f / 8; protected bool IsActive { get; private set; } @@ -206,6 +205,8 @@ private void adaptBounds(Vector2 position) BottomRight = new Vector2(BottomRight.X, position.Y); } + public abstract override double LifetimeEnd { get; } + private void onSmokeEnded(double time) { if (!IsActive) @@ -213,7 +214,6 @@ private void onSmokeEnded(double time) IsActive = false; SmokeEndTime = time; - LifetimeEnd = time + LifetimeAfterSmokeEnd + 100; } protected abstract override DrawNode CreateDrawNode();