1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 13:47:24 +08:00

Use IApplicableToDrawableHitObject for OsuModApproachDifferent

Replacing the obsolete interface.
This commit is contained in:
ekrctb 2021-06-16 22:05:23 +09:00
parent b6a9fa9999
commit 90a13b8ed3

View File

@ -1,9 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Bindables;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration;
@ -13,7 +11,7 @@ using osu.Game.Rulesets.Osu.Objects.Drawables;
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModApproachDifferent : Mod, IApplicableToDrawableHitObjects
public class OsuModApproachDifferent : Mod, IApplicableToDrawableHitObject
{
public override string Name => "Approach Different";
public override string Acronym => "AD";
@ -32,9 +30,7 @@ namespace osu.Game.Rulesets.Osu.Mods
[SettingSource("Style", "Change the animation style of the approach circles.", 1)]
public Bindable<AnimationStyle> Style { get; } = new Bindable<AnimationStyle>();
public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
{
drawables.ForEach(drawable =>
public void ApplyToDrawableHitObject(DrawableHitObject drawable)
{
drawable.ApplyCustomUpdateState += (drawableObject, state) =>
{
@ -47,7 +43,6 @@ namespace osu.Game.Rulesets.Osu.Mods
using (drawableHitCircle.BeginAbsoluteSequence(hitCircle.StartTime - hitCircle.TimePreempt))
drawableHitCircle.ApproachCircle.ScaleTo(Scale.Value).ScaleTo(1f, hitCircle.TimePreempt, getEasing(Style.Value));
};
});
}
private Easing getEasing(AnimationStyle style)