mirror of
https://github.com/ppy/osu
synced 2024-12-28 09:52:56 +00:00
Make OsuModHidden apply fadein adjustment on custom state update
This commit is contained in:
parent
f513c95ab2
commit
d1fa391d25
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user