Fix multiple issues with layout and text

This commit is contained in:
Dean Herbert 2022-06-07 20:02:26 +09:00
parent 43a04010a7
commit 146225d87e
1 changed files with 20 additions and 7 deletions

View File

@ -12,6 +12,7 @@
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
@ -125,7 +126,7 @@ You can click the targets but you don't have to.
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
TextAnchor = Anchor.TopCentre,
Y = 200,
Y = 150,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
},
@ -225,12 +226,21 @@ private void showResults()
float successRate = (float)correctCount / targetRoundCount;
bool isPass = successRate > 0.8f;
statusText.AddParagraph($"You scored {correctCount} out of {targetRoundCount} ({successRate:P0})!", cp => cp.Colour = isPass ? colours.Green : colours.Red);
statusText.AddParagraph($"Level {difficulty} (comparing {mapDifficultyToTargetFrameRate(difficulty):N0}hz with {host.UpdateThread.Clock.FramesPerSecond:N0}hz)",
statusText.AddParagraph($"You scored {correctCount} out of {targetRoundCount} ({successRate:0%})!", cp => cp.Colour = isPass ? colours.Green : colours.Red);
statusText.AddParagraph($"Level {difficulty} ({mapDifficultyToTargetFrameRate(difficulty):N0} hz)",
cp => cp.Font = OsuFont.Default.With(size: 24));
statusText.AddParagraph($"Input: {pollingMax}hz Monitor: {displayMode.RefreshRate:N0}hz Exclusive: {exclusive}", cp => cp.Font = OsuFont.Default.With(size: 15));
statusText.AddParagraph(string.Empty);
statusText.AddParagraph(string.Empty);
statusText.AddIcon(isPass ? FontAwesome.Regular.CheckCircle : FontAwesome.Regular.TimesCircle, cp => cp.Colour = isPass ? colours.Green : colours.Red);
statusText.AddParagraph(string.Empty);
statusText.AddParagraph($"Polling: {pollingMax} hz Monitor: {displayMode.RefreshRate:N0} hz Exclusive: {exclusive}", cp => cp.Font = OsuFont.Default.With(size: 15));
statusText.AddParagraph($"Input: {host.InputThread.Clock.FramesPerSecond} hz "
+ $"Update: {host.UpdateThread.Clock.FramesPerSecond} hz "
+ $"Draw: {host.DrawThread.Clock.FramesPerSecond} hz"
, cp => cp.Font = OsuFont.Default.With(size: 15));
string cannotIncreaseReason = string.Empty;
@ -243,9 +253,12 @@ private void showResults()
resultsArea.Add(new FillFlowContainer
{
RelativeSizeAxes = Axes.Both,
Y = 100,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Spacing = new Vector2(20),
Padding = new MarginPadding(20),
Children = new Drawable[]
{
new Button(Key.R)