mirror of
https://github.com/ppy/osu
synced 2024-12-27 17:32:56 +00:00
Fix remaining test failures
This commit is contained in:
parent
dd09d7830d
commit
866db629d6
@ -4,8 +4,8 @@
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Screens.Edit;
|
||||
using osu.Game.Screens.Edit.Components;
|
||||
using osuTK;
|
||||
|
||||
@ -17,9 +17,8 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
var clock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
|
||||
Dependencies.CacheAs<IAdjustableClock>(clock);
|
||||
Dependencies.CacheAs<IFrameBasedClock>(clock);
|
||||
var clock = new EditorClock { IsCoupled = false };
|
||||
Dependencies.CacheAs(clock);
|
||||
|
||||
var playback = new PlaybackControl
|
||||
{
|
||||
|
@ -102,7 +102,9 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
|
||||
private class StartStopButton : OsuButton
|
||||
{
|
||||
private IAdjustableClock adjustableClock;
|
||||
[Resolved]
|
||||
private EditorClock editorClock { get; set; }
|
||||
|
||||
private bool started;
|
||||
|
||||
public StartStopButton()
|
||||
@ -114,22 +116,16 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
Action = onClick;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(IAdjustableClock adjustableClock)
|
||||
{
|
||||
this.adjustableClock = adjustableClock;
|
||||
}
|
||||
|
||||
private void onClick()
|
||||
{
|
||||
if (started)
|
||||
{
|
||||
adjustableClock.Stop();
|
||||
editorClock.Stop();
|
||||
Text = "Start";
|
||||
}
|
||||
else
|
||||
{
|
||||
adjustableClock.Start();
|
||||
editorClock.Start();
|
||||
Text = "Stop";
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,11 @@ namespace osu.Game.Screens.Edit
|
||||
TrackLength = trackLength;
|
||||
}
|
||||
|
||||
public EditorClock()
|
||||
: this(new ControlPointInfo(), 1000, new BindableBeatDivisor())
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Seek to the closest snappable beat from a time.
|
||||
/// </summary>
|
||||
|
@ -8,6 +8,7 @@ using osu.Framework.Timing;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Screens.Edit;
|
||||
using osu.Game.Screens.Edit.Compose;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
@ -32,7 +33,7 @@ namespace osu.Game.Tests.Visual
|
||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||
{
|
||||
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||
dependencies.CacheAs<IAdjustableClock>(new StopwatchClock());
|
||||
dependencies.CacheAs(new EditorClock());
|
||||
|
||||
return dependencies;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user