1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-05 23:32:56 +08:00

Fix regression in testing and setting logic

This commit is contained in:
Dean Herbert 2022-06-10 20:33:01 +09:00
parent 8ce545ff9d
commit 096d6df868
2 changed files with 38 additions and 41 deletions

View File

@ -44,7 +44,6 @@ namespace osu.Game.Tests.Visual.Settings
clickUntilResults(true); clickUntilResults(true);
AddAssert("check at results", () => !latencyCertifier.ChildrenOfType<LatencyArea>().Any()); AddAssert("check at results", () => !latencyCertifier.ChildrenOfType<LatencyArea>().Any());
AddAssert("check no buttons", () => !latencyCertifier.ChildrenOfType<OsuButton>().Any());
checkDifficulty(1); checkDifficulty(1);
} }

View File

@ -90,8 +90,6 @@ namespace osu.Game.Screens.Utility
private double lastPoll; private double lastPoll;
private int pollingMax; private int pollingMax;
private readonly FillFlowContainer settings;
[Resolved] [Resolved]
private GameHost host { get; set; } = null!; private GameHost host { get; set; } = null!;
@ -130,7 +128,7 @@ namespace osu.Game.Screens.Utility
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopRight, Origin = Anchor.TopRight,
}, },
settings = new FillFlowContainer new FillFlowContainer
{ {
Name = "Settings", Name = "Settings",
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
@ -140,7 +138,9 @@ namespace osu.Game.Screens.Utility
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Anchor = Anchor.BottomCentre, Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre, Origin = Anchor.BottomCentre,
Child = explanatoryText = new LinkFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 20)) Children = new Drawable[]
{
explanatoryText = new LinkFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 20))
{ {
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
@ -148,6 +148,34 @@ namespace osu.Game.Screens.Utility
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
TextAnchor = Anchor.TopCentre, TextAnchor = Anchor.TopCentre,
}, },
new SettingsSlider<double>
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.None,
Width = 400,
LabelText = "bpm",
Current = SampleBPM
},
new SettingsSlider<float>
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.None,
Width = 400,
LabelText = "visual spacing",
Current = SampleVisualSpacing
},
new SettingsSlider<double>
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.None,
Width = 400,
LabelText = "approach rate",
Current = SampleApproachRate
},
},
}, },
resultsArea = new Container resultsArea = new Container
{ {
@ -227,6 +255,7 @@ namespace osu.Game.Screens.Utility
private void showResults() private void showResults()
{ {
mainArea.Clear(); mainArea.Clear();
resultsArea.Clear();
var displayMode = host.Window?.CurrentDisplayMode.Value; var displayMode = host.Window?.CurrentDisplayMode.Value;
@ -442,37 +471,6 @@ namespace osu.Game.Screens.Utility
mainArea.Children.First(a => a != area).IsActiveArea.Value = false; mainArea.Children.First(a => a != area).IsActiveArea.Value = false;
}); });
} }
settings.AddRange(new Drawable[]
{
new SettingsSlider<double>
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.None,
Width = 400,
LabelText = "bpm",
Current = SampleBPM
},
new SettingsSlider<float>
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.None,
Width = 400,
LabelText = "visual spacing",
Current = SampleVisualSpacing
},
new SettingsSlider<double>
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.None,
Width = 400,
LabelText = "approach rate",
Current = SampleApproachRate
},
});
} }
private void recordResult(bool correct) private void recordResult(bool correct)