2019-01-24 08:43:03 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
|
using System;
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Timing;
|
2019-02-12 04:04:46 +00:00
|
|
|
|
using osu.Game.Graphics;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Edit.Components
|
|
|
|
|
{
|
|
|
|
|
public class TimeInfoContainer : BottomBarContainer
|
|
|
|
|
{
|
|
|
|
|
private readonly OsuSpriteText trackTimer;
|
|
|
|
|
|
|
|
|
|
private IAdjustableClock adjustableClock;
|
|
|
|
|
|
|
|
|
|
public TimeInfoContainer()
|
|
|
|
|
{
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
trackTimer = new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
|
RelativePositionAxes = Axes.Y,
|
2019-02-12 04:04:46 +00:00
|
|
|
|
Font = OsuFont.GetFont(size: 22, fixedWidth: true),
|
2018-04-13 09:19:50 +00:00
|
|
|
|
Y = 0.5f,
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(IAdjustableClock adjustableClock)
|
|
|
|
|
{
|
|
|
|
|
this.adjustableClock = adjustableClock;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
|
|
|
|
|
trackTimer.Text = TimeSpan.FromMilliseconds(adjustableClock.CurrentTime).ToString(@"mm\:ss\:fff");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|