1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 22:22:55 +08:00
osu-lazer/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs

48 lines
1.3 KiB
C#
Raw Normal View History

2018-01-05 19:21:19 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// 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;
using osu.Framework.Timing;
2017-11-18 13:24:09 +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-19 15:27:52 +08:00
public TimeInfoContainer()
2017-11-18 13:24:09 +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();
trackTimer.Text = TimeSpan.FromMilliseconds(adjustableClock.CurrentTime).ToString(@"mm\:ss\:fff");
2017-11-18 13:24:09 +08:00
}
}
}