mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Make OsuModHidden apply fadein adjustment on custom state update
This commit is contained in:
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
@ -27,18 +26,20 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
|
|
||||||
public override void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
|
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)
|
||||||
|
d.ApplyCustomUpdateState += applyFadeInAdjustment;
|
||||||
foreach (var d in drawables.OfType<DrawableOsuHitObject>())
|
|
||||||
{
|
|
||||||
adjustFadeIn(d.HitObject);
|
|
||||||
foreach (var h in d.HitObject.NestedHitObjects.OfType<OsuHitObject>())
|
|
||||||
adjustFadeIn(h);
|
|
||||||
}
|
|
||||||
|
|
||||||
base.ApplyToDrawableHitObjects(drawables);
|
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 lastSliderHeadFadeOutStartTime;
|
||||||
private double lastSliderHeadFadeOutDuration;
|
private double lastSliderHeadFadeOutDuration;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user