mirror of
https://github.com/ppy/osu
synced 2025-01-25 07:13:22 +00:00
Merge pull request #30799 from peppy/fix-player-loader-focus-fux
Fix beatmap load not continuing when when settings slider is focused
This commit is contained in:
commit
479ff7eb41
@ -18,6 +18,7 @@ using osu.Framework.Testing;
|
|||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Overlays.Notifications;
|
using osu.Game.Overlays.Notifications;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
@ -207,7 +208,25 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestBlockLoadViaFocus()
|
public void TestLoadNotBlockedViaArbitraryFocus()
|
||||||
|
{
|
||||||
|
AddStep("load dummy beatmap", () => resetPlayer(false));
|
||||||
|
AddUntilStep("wait for current", () => loader.IsCurrentScreen());
|
||||||
|
|
||||||
|
AddUntilStep("click settings slider", () =>
|
||||||
|
{
|
||||||
|
InputManager.MoveMouseTo(loader.ChildrenOfType<OsuSliderBar<float>>().First());
|
||||||
|
InputManager.Click(MouseButton.Left);
|
||||||
|
|
||||||
|
return InputManager.FocusedDrawable is OsuSliderBar<float>;
|
||||||
|
});
|
||||||
|
|
||||||
|
AddUntilStep("wait for load ready", () => player?.LoadState == LoadState.Ready);
|
||||||
|
AddUntilStep("loads", () => !loader.IsCurrentScreen());
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestBlockLoadViaOverlayFocus()
|
||||||
{
|
{
|
||||||
AddStep("load dummy beatmap", () => resetPlayer(false));
|
AddStep("load dummy beatmap", () => resetPlayer(false));
|
||||||
AddUntilStep("wait for current", () => loader.IsCurrentScreen());
|
AddUntilStep("wait for current", () => loader.IsCurrentScreen());
|
||||||
|
@ -122,7 +122,9 @@ namespace osu.Game.Screens.Play
|
|||||||
// not ready if the user is dragging a slider or otherwise.
|
// not ready if the user is dragging a slider or otherwise.
|
||||||
&& (inputManager.DraggedDrawable == null || inputManager.DraggedDrawable is OsuLogo)
|
&& (inputManager.DraggedDrawable == null || inputManager.DraggedDrawable is OsuLogo)
|
||||||
// not ready if a focused overlay is visible, like settings.
|
// not ready if a focused overlay is visible, like settings.
|
||||||
&& inputManager.FocusedDrawable == null;
|
&& inputManager.FocusedDrawable is not OsuFocusedOverlayContainer
|
||||||
|
// or if a child of a focused overlay is focused, like settings' search textbox.
|
||||||
|
&& inputManager.FocusedDrawable?.FindClosestParent<OsuFocusedOverlayContainer>() == null;
|
||||||
|
|
||||||
private readonly Func<Player> createPlayer;
|
private readonly Func<Player> createPlayer;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user