1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 19:03:08 +08:00

Add slider combo change test

This commit is contained in:
smoogipoo 2019-09-26 17:39:26 +09:00
parent 45f2bcc440
commit e4e6634432
2 changed files with 35 additions and 5 deletions

View File

@ -297,11 +297,7 @@ namespace osu.Game.Rulesets.Osu.Tests
slider.ApplyDefaults(cpi, new BeatmapDifficulty { CircleSize = circleSize, SliderTickRate = 3 });
var drawable = new DrawableSlider(slider)
{
Anchor = Anchor.Centre,
Depth = depthIndex++
};
var drawable = CreateDrawableSlider(slider);
foreach (var mod in Mods.Value.OfType<IApplicableToDrawableHitObjects>())
mod.ApplyToDrawableHitObjects(new[] { drawable });
@ -311,6 +307,12 @@ namespace osu.Game.Rulesets.Osu.Tests
return drawable;
}
protected virtual DrawableSlider CreateDrawableSlider(Slider slider) => new DrawableSlider(slider)
{
Anchor = Anchor.Centre,
Depth = depthIndex++
};
private float judgementOffsetDirection = 1;
private void onNewResult(DrawableHitObject judgedObject, JudgementResult result)

View File

@ -0,0 +1,28 @@
// 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 osu.Framework.Bindables;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
namespace osu.Game.Rulesets.Osu.Tests
{
public class TestSceneSliderComboChange : TestSceneSlider
{
private readonly Bindable<int> comboIndex = new Bindable<int>();
protected override void LoadComplete()
{
base.LoadComplete();
Scheduler.AddDelayed(() => comboIndex.Value++, 250, true);
}
protected override DrawableSlider CreateDrawableSlider(Slider slider)
{
slider.ComboIndexBindable.BindTo(comboIndex);
slider.IndexInCurrentComboBindable.BindTo(comboIndex);
return base.CreateDrawableSlider(slider);
}
}
}