Add scrolling algorithm to global settings

This commit is contained in:
smoogipoo
2018-01-08 11:34:37 +09:00
parent 4ab3b0d76b
commit c4d1922c8b
11 changed files with 77 additions and 61 deletions

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Transforms;
@ -62,6 +63,11 @@ namespace osu.Game.Rulesets.UI.Scrolling
: base(customWidth)
{
this.direction = direction;
}
[BackgroundDependencyLoader]
private void load()
{
HitObjects.TimeRange.BindTo(VisibleTimeRange);
}
@ -107,13 +113,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
this.TransformTo(this.PopulateTransform(new TransformVisibleTimeRange(), newTimeRange, duration, easing));
}
protected sealed override HitObjectContainer CreateHitObjectContainer() => CreateScrollingHitObjectContainer();
/// <summary>
/// Creates the <see cref="ScrollingHitObjectContainer"/> that will handle the scrolling of the <see cref="DrawableHitObject"/>s.
/// </summary>
/// <returns></returns>
protected virtual ScrollingHitObjectContainer CreateScrollingHitObjectContainer() => new GlobalScrollingHitObjectContainer(direction);
protected sealed override HitObjectContainer CreateHitObjectContainer() => new ScrollingHitObjectContainer(direction);
private class TransformVisibleTimeRange : Transform<double, ScrollingPlayfield>
{