1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-27 16:10:16 +08:00

Add percent progress display to editor footer

This commit is contained in:
Dean Herbert
2025-02-10 14:51:48 +09:00
Unverified
parent cf4c9e7f9e
commit 274b422139
@@ -18,6 +18,7 @@ namespace osu.Game.Screens.Edit.Components
public partial class TimeInfoContainer : BottomBarContainer
{
private OsuSpriteText bpm = null!;
private OsuSpriteText progress = null!;
[Resolved]
private EditorBeatmap editorBeatmap { get; set; } = null!;
@@ -36,26 +37,44 @@ namespace osu.Game.Screens.Edit.Components
bpm = new OsuSpriteText
{
Colour = colours.Orange1,
Font = OsuFont.Torus.With(size: 14, weight: FontWeight.SemiBold, fixedWidth: true),
Spacing = new Vector2(-1, 0),
Position = new Vector2(0, 4),
Anchor = Anchor.CentreRight,
Origin = Anchor.TopRight,
},
progress = new OsuSpriteText
{
Colour = colours.Purple1,
Font = OsuFont.Torus.With(size: 14, weight: FontWeight.SemiBold, fixedWidth: true),
Spacing = new Vector2(-1, 0),
Anchor = Anchor.CentreLeft,
Font = OsuFont.Torus.With(size: 14, weight: FontWeight.SemiBold),
Position = new Vector2(2, 4),
}
};
}
private double? lastBPM;
private double? lastProgress;
protected override void Update()
{
base.Update();
double newBPM = editorBeatmap.ControlPointInfo.TimingPointAt(editorClock.CurrentTime).BPM;
double newProgress = (int)(editorClock.CurrentTime / editorClock.TrackLength * 100);
if (lastBPM != newBPM)
{
lastBPM = newBPM;
bpm.Text = @$"{newBPM:0} BPM";
}
if (lastProgress != newProgress)
{
lastProgress = newProgress;
progress.Text = @$"{newProgress:0}%";
}
}
private partial class TimestampControl : OsuClickableContainer