mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Update time info and add bpm
This commit is contained in:
@ -7,18 +7,23 @@ using osu.Framework.Allocation;
|
||||
using osu.Game.Extensions;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Overlays;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Components
|
||||
{
|
||||
public class TimeInfoContainer : BottomBarContainer
|
||||
{
|
||||
private OsuSpriteText trackTimer;
|
||||
private OsuSpriteText bpm;
|
||||
|
||||
[Resolved]
|
||||
private EditorBeatmap editorBeatmap { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private EditorClock editorClock { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
private void load(OsuColour colours, OverlayColourProvider colourProvider)
|
||||
{
|
||||
Background.Colour = colourProvider.Background5;
|
||||
|
||||
@ -28,10 +33,16 @@ namespace osu.Game.Screens.Edit.Components
|
||||
{
|
||||
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),
|
||||
Spacing = new Vector2(-2, 0),
|
||||
Font = OsuFont.Torus.With(size: 36, fixedWidth: true, weight: FontWeight.Light),
|
||||
Y = -10,
|
||||
},
|
||||
bpm = new OsuSpriteText
|
||||
{
|
||||
Colour = colours.Orange1,
|
||||
Anchor = Anchor.CentreRight,
|
||||
Font = OsuFont.Torus.With(size: 18, weight: FontWeight.SemiBold),
|
||||
Y = 5,
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -40,6 +51,8 @@ namespace osu.Game.Screens.Edit.Components
|
||||
{
|
||||
base.Update();
|
||||
trackTimer.Text = editorClock.CurrentTime.ToEditorFormattedString();
|
||||
bpm.Text = @$"{editorBeatmap.ControlPointInfo.TimingPointAt(editorClock.CurrentTime).BPM:0} BPM";
|
||||
bpm.X = 5 - trackTimer.DrawWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user