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

Applied suggested changes.

This commit is contained in:
smoogipooo 2017-08-09 14:10:10 +09:00
parent 59c9eb7d8d
commit a20753abc6
3 changed files with 11 additions and 34 deletions

View File

@ -53,7 +53,7 @@ namespace osu.Desktop.Tests.Visual
TestHitRenderer hitRenderer; TestHitRenderer hitRenderer;
Add(hitRenderer = new TestHitRenderer(beatmap, true)); Add(hitRenderer = new TestHitRenderer(beatmap, true));
AddStep("Reverse direction", () => hitRenderer.Playfield.Reversed.Value = !hitRenderer.Playfield.Reversed); AddStep("Reverse direction", () => hitRenderer.Playfield.Reversed.Toggle());
} }
private class TestHitRenderer : ScrollingHitRenderer<TestPlayfield, TestHitObject, TestJudgement> private class TestHitRenderer : ScrollingHitRenderer<TestPlayfield, TestHitObject, TestJudgement>

View File

@ -16,25 +16,15 @@ namespace osu.Game.Rulesets.Timing
/// </summary> /// </summary>
public class SpeedAdjustmentContainer : Container<DrawableHitObject> public class SpeedAdjustmentContainer : Container<DrawableHitObject>
{ {
private readonly Bindable<double> visibleTimeRange = new Bindable<double> { Default = 1000 };
/// <summary> /// <summary>
/// Gets or sets the range of time that is visible by the length of the scrolling axes. /// Gets or sets the range of time that is visible by the length of the scrolling axes.
/// </summary> /// </summary>
public Bindable<double> VisibleTimeRange public readonly Bindable<double> VisibleTimeRange = new Bindable<double> { Default = 1000 };
{
get { return visibleTimeRange; }
set { visibleTimeRange.BindTo(value); }
}
private readonly BindableBool reversed = new BindableBool();
/// <summary> /// <summary>
/// Whether to reverse the scrolling direction is reversed. /// Whether to reverse the scrolling direction is reversed.
/// </summary> /// </summary>
public BindableBool Reversed public readonly BindableBool Reversed = new BindableBool();
{
get { return reversed; }
set { reversed.BindTo(value); }
}
protected override Container<DrawableHitObject> Content => content; protected override Container<DrawableHitObject> Content => content;
private Container<DrawableHitObject> content; private Container<DrawableHitObject> content;

View File

@ -71,12 +71,9 @@ namespace osu.Game.Rulesets.UI
protected ScrollingPlayfield(Axes scrollingAxes, float? customWidth = null) protected ScrollingPlayfield(Axes scrollingAxes, float? customWidth = null)
: base(customWidth) : base(customWidth)
{ {
base.HitObjects = HitObjects = new ScrollingHitObjectContainer(scrollingAxes) base.HitObjects = HitObjects = new ScrollingHitObjectContainer(scrollingAxes) { RelativeSizeAxes = Axes.Both };
{ HitObjects.VisibleTimeRange.BindTo(VisibleTimeRange);
RelativeSizeAxes = Axes.Both, HitObjects.Reversed.BindTo(Reversed);
VisibleTimeRange = VisibleTimeRange,
Reversed = Reversed
};
} }
private List<ScrollingPlayfield<TObject, TJudgement>> nestedPlayfields; private List<ScrollingPlayfield<TObject, TJudgement>> nestedPlayfields;
@ -142,26 +139,16 @@ namespace osu.Game.Rulesets.UI
/// </summary> /// </summary>
internal class ScrollingHitObjectContainer : HitObjectContainer internal class ScrollingHitObjectContainer : HitObjectContainer
{ {
private readonly BindableDouble visibleTimeRange = new BindableDouble { Default = 1000 };
/// <summary> /// <summary>
/// Gets or sets the range of time that is visible by the length of the scrolling axes. /// Gets or sets the range of time that is visible by the length of the scrolling axes.
/// For example, only hit objects with start time less than or equal to 1000 will be visible with <see cref="VisibleTimeRange"/> = 1000. /// For example, only hit objects with start time less than or equal to 1000 will be visible with <see cref="VisibleTimeRange"/> = 1000.
/// </summary> /// </summary>
public Bindable<double> VisibleTimeRange public readonly BindableDouble VisibleTimeRange = new BindableDouble { Default = 1000 };
{
get { return visibleTimeRange; }
set { visibleTimeRange.BindTo(value); }
}
private readonly BindableBool reversed = new BindableBool();
/// <summary> /// <summary>
/// Whether to reverse the scrolling direction is reversed. /// Whether to reverse the scrolling direction is reversed.
/// </summary> /// </summary>
public BindableBool Reversed public readonly BindableBool Reversed = new BindableBool();
{
get { return reversed; }
set { reversed.BindTo(value); }
}
/// <summary> /// <summary>
/// Hit objects that are to be re-processed on the next update. /// Hit objects that are to be re-processed on the next update.
@ -186,11 +173,11 @@ namespace osu.Game.Rulesets.UI
/// <param name="speedAdjustment">The <see cref="SpeedAdjustmentContainer"/>.</param> /// <param name="speedAdjustment">The <see cref="SpeedAdjustmentContainer"/>.</param>
public void AddSpeedAdjustment(SpeedAdjustmentContainer speedAdjustment) public void AddSpeedAdjustment(SpeedAdjustmentContainer speedAdjustment)
{ {
speedAdjustment.VisibleTimeRange.BindTo(VisibleTimeRange);
speedAdjustment.ScrollingAxes = scrollingAxes; speedAdjustment.ScrollingAxes = scrollingAxes;
speedAdjustment.Reversed = Reversed; speedAdjustment.VisibleTimeRange.BindTo(VisibleTimeRange);
speedAdjustments.Add(speedAdjustment); speedAdjustment.Reversed.BindTo(Reversed);
speedAdjustments.Add(speedAdjustment);
AddInternal(speedAdjustment); AddInternal(speedAdjustment);
} }