mirror of
https://github.com/ppy/osu.git
synced 2025-01-08 03:52:56 +08:00
Remove frozen clock from test scenes
This commit is contained in:
parent
366dc7085d
commit
63708532a1
@ -4,7 +4,6 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Timing;
|
|
||||||
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.UI.Scrolling;
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
@ -37,10 +36,13 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
|||||||
Child = new ScrollingHitObjectContainer
|
Child = new ScrollingHitObjectContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Clock = new FramedClock(new StopwatchClock()),
|
|
||||||
}.With(c =>
|
}.With(c =>
|
||||||
{
|
{
|
||||||
c.Add(CreateHitObject().With(h => h.AccentColour.Value = Color4.Orange));
|
c.Add(CreateHitObject().With(h =>
|
||||||
|
{
|
||||||
|
h.HitObject.StartTime = START_TIME;
|
||||||
|
h.AccentColour.Value = Color4.Orange;
|
||||||
|
}));
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
new ColumnTestContainer(1, ManiaAction.Key2)
|
new ColumnTestContainer(1, ManiaAction.Key2)
|
||||||
@ -52,10 +54,13 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
|||||||
Child = new ScrollingHitObjectContainer
|
Child = new ScrollingHitObjectContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Clock = new FramedClock(new StopwatchClock()),
|
|
||||||
}.With(c =>
|
}.With(c =>
|
||||||
{
|
{
|
||||||
c.Add(CreateHitObject().With(h => h.AccentColour.Value = Color4.Orange));
|
c.Add(CreateHitObject().With(h =>
|
||||||
|
{
|
||||||
|
h.HitObject.StartTime = START_TIME;
|
||||||
|
h.AccentColour.Value = Color4.Orange;
|
||||||
|
}));
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,8 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class ManiaSkinnableTestScene : SkinnableTestScene
|
public abstract class ManiaSkinnableTestScene : SkinnableTestScene
|
||||||
{
|
{
|
||||||
|
protected const double START_TIME = 1000000000;
|
||||||
|
|
||||||
[Cached(Type = typeof(IScrollingInfo))]
|
[Cached(Type = typeof(IScrollingInfo))]
|
||||||
private readonly TestScrollingInfo scrollingInfo = new TestScrollingInfo();
|
private readonly TestScrollingInfo scrollingInfo = new TestScrollingInfo();
|
||||||
|
|
||||||
@ -52,7 +54,26 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
|||||||
|
|
||||||
IBindable<ScrollingDirection> IScrollingInfo.Direction => Direction;
|
IBindable<ScrollingDirection> IScrollingInfo.Direction => Direction;
|
||||||
IBindable<double> IScrollingInfo.TimeRange { get; } = new Bindable<double>(1000);
|
IBindable<double> IScrollingInfo.TimeRange { get; } = new Bindable<double>(1000);
|
||||||
IScrollAlgorithm IScrollingInfo.Algorithm { get; } = new ConstantScrollAlgorithm();
|
IScrollAlgorithm IScrollingInfo.Algorithm { get; } = new ZeroScrollAlgorithm();
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ZeroScrollAlgorithm : IScrollAlgorithm
|
||||||
|
{
|
||||||
|
public double GetDisplayStartTime(double originTime, float offset, double timeRange, float scrollLength)
|
||||||
|
=> double.MinValue;
|
||||||
|
|
||||||
|
public float GetLength(double startTime, double endTime, double timeRange, float scrollLength)
|
||||||
|
=> scrollLength;
|
||||||
|
|
||||||
|
public float PositionAt(double time, double currentTime, double timeRange, float scrollLength)
|
||||||
|
=> (float)((time - START_TIME) / timeRange) * scrollLength;
|
||||||
|
|
||||||
|
public double TimeAt(float position, double currentTime, double timeRange, float scrollLength)
|
||||||
|
=> 0;
|
||||||
|
|
||||||
|
public void Reset()
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,10 +15,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
|||||||
var note = new HoldNote { Duration = 1000 };
|
var note = new HoldNote { Duration = 1000 };
|
||||||
note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||||
|
|
||||||
return new DrawableHoldNote(note)
|
return new DrawableHoldNote(note);
|
||||||
{
|
|
||||||
Height = 200,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user