Skip to content

Commit d1c0d58

Browse files
committed
Fix player settings no longer collapsing correctly
Regressed with ppy#33621 for obvious reasons. Tachyon doing its job, caught this before hitting a proper release.
1 parent 768d445 commit d1c0d58

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

osu.Game.Tests/Visual/Gameplay/TestSceneReplayPlayer.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using osu.Game.Rulesets.Osu.Replays;
1313
using osu.Game.Scoring;
1414
using osu.Game.Screens.Play;
15+
using osu.Game.Screens.Play.HUD;
1516
using osu.Game.Tests.Beatmaps;
1617
using osu.Game.Tests.Resources;
1718
using osuTK;
@@ -192,6 +193,20 @@ public void TestReplayDoesNotFailUntilRunningOutOfFrames()
192193
AddAssert("player failed after 10000", () => Player.GameplayClockContainer.CurrentTime, () => Is.GreaterThanOrEqualTo(10000));
193194
}
194195

196+
[Test]
197+
public void TestPlayerLoaderSettingsHover()
198+
{
199+
loadPlayerWithBeatmap();
200+
201+
AddUntilStep("wait for settings overlay hidden", () => settingsOverlay().Expanded.Value, () => Is.False);
202+
AddStep("move mouse to right of screen", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.TopRight));
203+
AddUntilStep("wait for settings overlay visible", () => settingsOverlay().Expanded.Value, () => Is.True);
204+
AddStep("move mouse to centre of screen", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.Centre));
205+
AddUntilStep("wait for settings overlay hidden", () => settingsOverlay().Expanded.Value, () => Is.False);
206+
207+
PlayerSettingsOverlay settingsOverlay() => Player.ChildrenOfType<PlayerSettingsOverlay>().Single();
208+
}
209+
195210
private void loadPlayerWithBeatmap(IBeatmap? beatmap = null)
196211
{
197212
AddStep("create player", () =>

osu.Game/Graphics/Containers/ExpandingContainer.cs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
22
// See the LICENCE file in the repository root for full licence text.
33

4-
using osu.Framework.Allocation;
54
using osu.Framework.Bindables;
65
using osu.Framework.Graphics;
76
using osu.Framework.Graphics.Containers;
@@ -41,24 +40,20 @@ protected ExpandingContainer(float contractedWidth, float expandedWidth)
4140
RelativeSizeAxes = Axes.Y;
4241
Width = contractedWidth;
4342

44-
FillFlow = new FillFlowContainer
45-
{
46-
Origin = Anchor.CentreLeft,
47-
Anchor = Anchor.CentreLeft,
48-
RelativeSizeAxes = Axes.X,
49-
AutoSizeAxes = Axes.Y,
50-
Direction = FillDirection.Vertical,
51-
};
52-
}
53-
54-
[BackgroundDependencyLoader]
55-
private void load()
56-
{
5743
InternalChild = CreateScrollContainer().With(s =>
5844
{
5945
s.RelativeSizeAxes = Axes.Both;
6046
s.ScrollbarVisible = false;
61-
}).WithChild(FillFlow);
47+
}).WithChild(
48+
FillFlow = new FillFlowContainer
49+
{
50+
Origin = Anchor.CentreLeft,
51+
Anchor = Anchor.CentreLeft,
52+
RelativeSizeAxes = Axes.X,
53+
AutoSizeAxes = Axes.Y,
54+
Direction = FillDirection.Vertical,
55+
}
56+
);
6257
}
6358

6459
protected virtual OsuScrollContainer CreateScrollContainer() => new OsuScrollContainer();

0 commit comments

Comments
 (0)