1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 03:17:25 +08:00
osu-lazer/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.2 KiB
C#
Raw Normal View History

// 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 17:19:50 +08:00
2017-11-18 13:24:09 +08:00
using osu.Framework.Graphics;
using osu.Game.Graphics.Sprites;
2018-03-19 15:27:52 +08:00
using osu.Framework.Allocation;
using osu.Game.Extensions;
using osu.Game.Graphics;
2018-04-13 17:19:50 +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-04-13 17:19:50 +08:00
2020-02-14 21:14:00 +08:00
[Resolved]
private EditorClock editorClock { get; set; }
2018-04-13 17:19:50 +08:00
2018-03-19 15:27:52 +08:00
public TimeInfoContainer()
2017-11-18 13:24:09 +08:00
{
Children = new Drawable[]
{
trackTimer = new OsuSpriteText
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
// intentionally fudged centre to avoid movement of the number portion when
// going negative.
X = -35,
Font = OsuFont.GetFont(size: 25, fixedWidth: true),
2017-11-18 13:24:09 +08:00
}
};
}
2018-04-13 17:19:50 +08:00
2017-11-18 13:24:09 +08:00
protected override void Update()
{
base.Update();
trackTimer.Text = editorClock.CurrentTime.ToEditorFormattedString();
2017-11-18 13:24:09 +08:00
}
}
}