mirror of
https://github.com/ppy/osu
synced 2025-03-10 21:38:23 +00:00
Fix multiple issues with layout and text
This commit is contained in:
parent
43a04010a7
commit
146225d87e
@ -12,6 +12,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
@ -125,7 +126,7 @@ Do whatever you need to try and perceive the difference in latency, then choose
|
|||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
TextAnchor = Anchor.TopCentre,
|
TextAnchor = Anchor.TopCentre,
|
||||||
Y = 200,
|
Y = 150,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
},
|
},
|
||||||
@ -225,12 +226,21 @@ Do whatever you need to try and perceive the difference in latency, then choose
|
|||||||
float successRate = (float)correctCount / targetRoundCount;
|
float successRate = (float)correctCount / targetRoundCount;
|
||||||
bool isPass = successRate > 0.8f;
|
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($"You scored {correctCount} out of {targetRoundCount} ({successRate:0%})!", cp => cp.Colour = isPass ? colours.Green : colours.Red);
|
||||||
|
statusText.AddParagraph($"Level {difficulty} ({mapDifficultyToTargetFrameRate(difficulty):N0} hz)",
|
||||||
statusText.AddParagraph($"Level {difficulty} (comparing {mapDifficultyToTargetFrameRate(difficulty):N0}hz with {host.UpdateThread.Clock.FramesPerSecond:N0}hz)",
|
|
||||||
cp => cp.Font = OsuFont.Default.With(size: 24));
|
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;
|
string cannotIncreaseReason = string.Empty;
|
||||||
|
|
||||||
@ -243,9 +253,12 @@ Do whatever you need to try and perceive the difference in latency, then choose
|
|||||||
|
|
||||||
resultsArea.Add(new FillFlowContainer
|
resultsArea.Add(new FillFlowContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.X,
|
||||||
Y = 100,
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft,
|
||||||
Spacing = new Vector2(20),
|
Spacing = new Vector2(20),
|
||||||
|
Padding = new MarginPadding(20),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Button(Key.R)
|
new Button(Key.R)
|
||||||
|
Loading…
Reference in New Issue
Block a user