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
|
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2017-11-18 05:24:09 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2018-03-19 07:27:52 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2020-09-30 03:45:43 +00:00
|
|
|
|
using osu.Game.Extensions;
|
2019-02-12 04:04:46 +00:00
|
|
|
|
using osu.Game.Graphics;
|
2022-05-25 14:17:52 +00:00
|
|
|
|
using osu.Game.Overlays;
|
2022-05-25 14:30:53 +00:00
|
|
|
|
using osuTK;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-11-17 09:26:13 +00:00
|
|
|
|
namespace osu.Game.Screens.Edit.Components
|
|
|
|
|
{
|
|
|
|
|
public class TimeInfoContainer : BottomBarContainer
|
|
|
|
|
{
|
2022-05-25 14:17:52 +00:00
|
|
|
|
private OsuSpriteText trackTimer;
|
2022-05-25 14:30:53 +00:00
|
|
|
|
private OsuSpriteText bpm;
|
|
|
|
|
|
|
|
|
|
[Resolved]
|
|
|
|
|
private EditorBeatmap editorBeatmap { get; set; }
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2020-02-14 13:14:00 +00:00
|
|
|
|
[Resolved]
|
2020-05-22 07:37:28 +00:00
|
|
|
|
private EditorClock editorClock { get; set; }
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2022-05-25 14:17:52 +00:00
|
|
|
|
[BackgroundDependencyLoader]
|
2022-05-25 14:30:53 +00:00
|
|
|
|
private void load(OsuColour colours, OverlayColourProvider colourProvider)
|
2017-11-18 05:24:09 +00:00
|
|
|
|
{
|
2022-05-25 14:17:52 +00:00
|
|
|
|
Background.Colour = colourProvider.Background5;
|
|
|
|
|
|
2017-11-18 05:24:09 +00:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
trackTimer = new OsuSpriteText
|
|
|
|
|
{
|
2022-05-26 09:12:28 +00:00
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
|
Origin = Anchor.CentreLeft,
|
2022-05-25 14:30:53 +00:00
|
|
|
|
Spacing = new Vector2(-2, 0),
|
|
|
|
|
Font = OsuFont.Torus.With(size: 36, fixedWidth: true, weight: FontWeight.Light),
|
|
|
|
|
Y = -10,
|
|
|
|
|
},
|
|
|
|
|
bpm = new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Colour = colours.Orange1,
|
2022-05-26 09:12:28 +00:00
|
|
|
|
Anchor = Anchor.CentreLeft,
|
2022-05-25 14:30:53 +00:00
|
|
|
|
Font = OsuFont.Torus.With(size: 18, weight: FontWeight.SemiBold),
|
2022-05-26 09:12:28 +00:00
|
|
|
|
Position = new Vector2(2, 5),
|
2017-11-18 05:24:09 +00:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-11-18 05:24:09 +00:00
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
2020-09-30 03:45:43 +00:00
|
|
|
|
trackTimer.Text = editorClock.CurrentTime.ToEditorFormattedString();
|
2022-05-25 14:30:53 +00:00
|
|
|
|
bpm.Text = @$"{editorBeatmap.ControlPointInfo.TimingPointAt(editorClock.CurrentTime).BPM:0} BPM";
|
2017-11-18 05:24:09 +00:00
|
|
|
|
}
|
2017-11-17 09:26:13 +00:00
|
|
|
|
}
|
|
|
|
|
}
|