1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +08:00

Add draw width statistic to test

This commit is contained in:
Joseph Madamba 2023-10-10 15:05:34 -07:00
parent 39b008b070
commit 43c8d51d02

View File

@ -5,6 +5,7 @@ using System;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Leaderboards; using osu.Game.Online.Leaderboards;
using osu.Game.Overlays; using osu.Game.Overlays;
@ -25,17 +26,22 @@ namespace osu.Game.Tests.Visual.SongSelect
private OverlayColourProvider colourProvider { get; set; } = new OverlayColourProvider(OverlayColourScheme.Aquamarine); private OverlayColourProvider colourProvider { get; set; } = new OverlayColourProvider(OverlayColourScheme.Aquamarine);
private FillFlowContainer fillFlow = null!; private FillFlowContainer fillFlow = null!;
private OsuSpriteText drawWidthText = null!;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
Child = fillFlow = new FillFlowContainer Children = new Drawable[]
{ {
Anchor = Anchor.Centre, fillFlow = new FillFlowContainer
Origin = Anchor.Centre, {
Spacing = new Vector2(0, 10), Anchor = Anchor.Centre,
RelativeSizeAxes = Axes.X, Origin = Anchor.Centre,
AutoSizeAxes = Axes.Y, Spacing = new Vector2(0, 10),
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
},
drawWidthText = new OsuSpriteText(),
}; };
foreach (var scoreInfo in getTestScores()) foreach (var scoreInfo in getTestScores())
@ -50,6 +56,13 @@ namespace osu.Game.Tests.Visual.SongSelect
}); });
} }
protected override void UpdateAfterChildren()
{
base.UpdateAfterChildren();
drawWidthText.Text = $"DrawWidth: {fillFlow.DrawWidth}";
}
private static ScoreInfo[] getTestScores() private static ScoreInfo[] getTestScores()
{ {
var scores = new[] var scores = new[]