1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 12:02:54 +08:00

Add explanatory text

This commit is contained in:
Dean Herbert 2022-06-07 15:21:19 +09:00
parent c323c67d7d
commit 3bd8bbd297

View File

@ -17,7 +17,6 @@ using osu.Framework.Screens;
using osu.Framework.Utils;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
using osu.Game.Overlays.Settings;
using osuTK;
@ -37,6 +36,8 @@ namespace osu.Game.Screens
public override float BackgroundParallaxAmount => 0;
private readonly OsuTextFlowContainer explanatoryText;
private readonly Container mainArea;
private readonly Container resultsArea;
@ -79,6 +80,20 @@ namespace osu.Game.Screens
Anchor = Anchor.TopCentre,
Origin = Anchor.TopRight,
},
explanatoryText = new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 20))
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
TextAnchor = Anchor.TopCentre,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Y = 200,
Text = @"Welcome to the latency comparer!
Use the arrow keys or Z/X to move the square.
You can click the targets but you don't have to.
Do whatever you need to try and perceive the difference in latency, then choose your best side.
",
},
statusText = new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 40))
{
Anchor = Anchor.Centre,
@ -126,6 +141,8 @@ namespace osu.Game.Screens
private void recordResult(bool correct)
{
explanatoryText.FadeOut(500, Easing.OutQuint);
if (correct)
correctCount++;
@ -198,7 +215,7 @@ namespace osu.Game.Screens
public Action? ReportBetter { get; set; }
private Drawable background = null!;
private Drawable? background;
private readonly int inducedLatency;