Pass adjustable clocks to components, rather than relying on the track

This commit is contained in:
smoogipoo
2018-03-15 18:08:37 +09:00
parent c8f6a6980b
commit d05947ef48
6 changed files with 33 additions and 24 deletions

View File

@ -4,6 +4,7 @@
using osu.Framework.Graphics;
using osu.Game.Graphics.Sprites;
using System;
using osu.Framework.Timing;
namespace osu.Game.Screens.Edit.Components
{
@ -13,8 +14,12 @@ namespace osu.Game.Screens.Edit.Components
private readonly OsuSpriteText trackTimer;
public TimeInfoContainer()
private readonly IAdjustableClock adjustableClock;
public TimeInfoContainer(IAdjustableClock adjustableClock)
{
this.adjustableClock = adjustableClock;
Children = new Drawable[]
{
trackTimer = new OsuSpriteText
@ -32,7 +37,7 @@ namespace osu.Game.Screens.Edit.Components
{
base.Update();
trackTimer.Text = TimeSpan.FromMilliseconds(Track.CurrentTime).ToString(@"mm\:ss\:fff");
trackTimer.Text = TimeSpan.FromMilliseconds(adjustableClock.CurrentTime).ToString(@"mm\:ss\:fff");
}
}
}