mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 09:07:25 +08:00
48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
using osu.Framework.Graphics;
|
|
using osu.Game.Graphics.Sprites;
|
|
using System;
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Timing;
|
|
|
|
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,
|
|
TextSize = 22,
|
|
FixedWidth = true,
|
|
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");
|
|
}
|
|
}
|
|
}
|