2018-01-05 19:21:19 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-11-17 17:26:13 +08:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2017-11-18 13:24:09 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
|
using System;
|
2018-03-19 15:27:52 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2018-03-15 17:08:37 +08:00
|
|
|
|
using osu.Framework.Timing;
|
2017-11-18 13:24:09 +08:00
|
|
|
|
|
2017-11-17 17:26:13 +08:00
|
|
|
|
namespace osu.Game.Screens.Edit.Components
|
|
|
|
|
{
|
|
|
|
|
public class TimeInfoContainer : BottomBarContainer
|
|
|
|
|
{
|
2017-11-18 13:24:09 +08:00
|
|
|
|
private readonly OsuSpriteText trackTimer;
|
|
|
|
|
|
2018-03-19 15:27:52 +08:00
|
|
|
|
private IAdjustableClock adjustableClock;
|
2018-03-15 17:08:37 +08:00
|
|
|
|
|
2018-03-19 15:27:52 +08:00
|
|
|
|
public TimeInfoContainer()
|
2017-11-18 13:24:09 +08:00
|
|
|
|
{
|
2018-03-15 17:08:37 +08:00
|
|
|
|
|
2017-11-18 13:24:09 +08:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
trackTimer = new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
|
RelativePositionAxes = Axes.Y,
|
|
|
|
|
TextSize = 22,
|
|
|
|
|
FixedWidth = true,
|
|
|
|
|
Y = 0.5f,
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-19 15:27:52 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(IAdjustableClock adjustableClock)
|
|
|
|
|
{
|
|
|
|
|
this.adjustableClock = adjustableClock;
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-18 13:24:09 +08:00
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
|
2018-03-15 17:08:37 +08:00
|
|
|
|
trackTimer.Text = TimeSpan.FromMilliseconds(adjustableClock.CurrentTime).ToString(@"mm\:ss\:fff");
|
2017-11-18 13:24:09 +08:00
|
|
|
|
}
|
2017-11-17 17:26:13 +08:00
|
|
|
|
}
|
|
|
|
|
}
|