Make OsuModHidden apply fadein adjustment on custom state update

This commit is contained in:
smoogipoo 2020-11-05 16:12:55 +09:00
parent f513c95ab2
commit d1fa391d25

View File

@ -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<DrawableHitObject> drawables)
{
static void adjustFadeIn(OsuHitObject h) => h.TimeFadeIn = h.TimePreempt * fade_in_duration_multiplier;
foreach (var d in drawables.OfType<DrawableOsuHitObject>())
{
adjustFadeIn(d.HitObject);
foreach (var h in d.HitObject.NestedHitObjects.OfType<OsuHitObject>())
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;