From d1fa391d251e0d67a02b2c8eb68e1b777567c257 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 5 Nov 2020 16:12:55 +0900 Subject: [PATCH] Make OsuModHidden apply fadein adjustment on custom state update --- osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs b/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs index db5fbb0dd6..025e202666 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Linq; using osu.Framework.Graphics; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects; @@ -27,18 +26,20 @@ namespace osu.Game.Rulesets.Osu.Mods public override void ApplyToDrawableHitObjects(IEnumerable drawables) { - static void adjustFadeIn(OsuHitObject h) => h.TimeFadeIn = h.TimePreempt * fade_in_duration_multiplier; - - foreach (var d in drawables.OfType()) - { - adjustFadeIn(d.HitObject); - foreach (var h in d.HitObject.NestedHitObjects.OfType()) - adjustFadeIn(h); - } + foreach (var d in drawables) + d.ApplyCustomUpdateState += applyFadeInAdjustment; base.ApplyToDrawableHitObjects(drawables); } + private void applyFadeInAdjustment(DrawableHitObject hitObject, ArmedState state) + { + if (!(hitObject is DrawableOsuHitObject d)) + return; + + d.HitObject.TimeFadeIn = d.HitObject.TimePreempt * fade_in_duration_multiplier; + } + private double lastSliderHeadFadeOutStartTime; private double lastSliderHeadFadeOutDuration;