1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-08 16:07:31 +08:00

Merge branch 'master' into master

This commit is contained in:
Dean Herbert 2019-05-12 15:56:59 +09:00 committed by GitHub
commit fb410a11c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 16 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
@ -34,20 +35,20 @@ namespace osu.Game.Tests.Visual.Gameplay
[Test]
public void TestLoadContinuation()
{
AddStep("load dummy beatmap", () => stack.Push(loader = new PlayerLoader(() => new Player(false, false))));
Player player = null;
SlowLoadPlayer slowPlayer = null;
AddStep("load dummy beatmap", () => stack.Push(loader = new PlayerLoader(() => player = new Player(false, false))));
AddUntilStep("wait for current", () => loader.IsCurrentScreen());
AddStep("mouse in centre", () => InputManager.MoveMouseTo(loader.ScreenSpaceDrawQuad.Centre));
AddUntilStep("wait for no longer current", () => !loader.IsCurrentScreen());
AddUntilStep("wait for player to be current", () => player.IsCurrentScreen());
AddStep("load slow dummy beatmap", () =>
{
SlowLoadPlayer slow = null;
stack.Push(loader = new PlayerLoader(() => slow = new SlowLoadPlayer(false, false)));
Scheduler.AddDelayed(() => slow.Ready = true, 5000);
stack.Push(loader = new PlayerLoader(() => slowPlayer = new SlowLoadPlayer(false, false)));
Scheduler.AddDelayed(() => slowPlayer.AllowLoad.Set(), 5000);
});
AddUntilStep("wait for no longer current", () => !loader.IsCurrentScreen());
AddUntilStep("wait for player to be current", () => slowPlayer.IsCurrentScreen());
}
[Test]
@ -113,7 +114,7 @@ namespace osu.Game.Tests.Visual.Gameplay
protected class SlowLoadPlayer : Player
{
public bool Ready;
public readonly ManualResetEventSlim AllowLoad = new ManualResetEventSlim(false);
public SlowLoadPlayer(bool allowPause = true, bool showResults = true)
: base(allowPause, showResults)
@ -123,8 +124,8 @@ namespace osu.Game.Tests.Visual.Gameplay
[BackgroundDependencyLoader]
private void load()
{
while (!Ready)
Thread.Sleep(1);
if (!AllowLoad.Wait(TimeSpan.FromSeconds(10)))
throw new TimeoutException();
}
}
}

View File

@ -39,6 +39,7 @@ namespace osu.Game.Screens.Select
public abstract class SongSelect : OsuScreen
{
private static readonly Vector2 wedged_container_size = new Vector2(0.5f, 245);
protected const float BACKGROUND_BLUR = 20;
private const float left_area_padding = 20;
@ -89,8 +90,6 @@ namespace osu.Game.Screens.Select
protected SongSelect()
{
const float carousel_width = 640;
AddRangeInternal(new Drawable[]
{
new ParallaxContainer
@ -103,7 +102,8 @@ namespace osu.Game.Screens.Select
new WedgeBackground
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Right = carousel_width * 0.76f },
Padding = new MarginPadding { Right = -150 },
Size = new Vector2(wedged_container_size.X, 1),
}
}
},
@ -144,8 +144,8 @@ namespace osu.Game.Screens.Select
Carousel = new BeatmapCarousel
{
Masking = false,
RelativeSizeAxes = Axes.Y,
Size = new Vector2(carousel_width, 1),
RelativeSizeAxes = Axes.Both,
Size = new Vector2(1 - wedged_container_size.X, 1),
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
SelectionChanged = updateSelectedBeatmap,
@ -505,6 +505,8 @@ namespace osu.Game.Screens.Select
{
ModSelect.Hide();
BeatmapOptions.Hide();
this.ScaleTo(1.1f, 250, Easing.InSine);
this.FadeOut(250);