mirror of
https://github.com/ppy/osu.git
synced 2024-12-05 10:23:20 +08:00
Merge 53dce83b56
into f09d8f097a
This commit is contained in:
commit
89f4e4d64e
@ -21,7 +21,7 @@ namespace osu.Game.Tests.Visual.Mods
|
|||||||
protected override TestPlayer CreateModPlayer(Ruleset ruleset)
|
protected override TestPlayer CreateModPlayer(Ruleset ruleset)
|
||||||
{
|
{
|
||||||
var player = base.CreateModPlayer(ruleset);
|
var player = base.CreateModPlayer(ruleset);
|
||||||
player.RestartRequested = _ => restartRequested = true;
|
player.PrepareLoaderForRestart = _ => restartRequested = true;
|
||||||
return player;
|
return player;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ namespace osu.Game.Screens.Play
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual bool PauseOnFocusLost => true;
|
protected virtual bool PauseOnFocusLost => true;
|
||||||
|
|
||||||
public Action<bool> RestartRequested;
|
public Action<bool> PrepareLoaderForRestart;
|
||||||
|
|
||||||
private bool isRestarting;
|
private bool isRestarting;
|
||||||
private bool skipExitTransition;
|
private bool skipExitTransition;
|
||||||
@ -719,10 +719,16 @@ namespace osu.Game.Screens.Play
|
|||||||
// stopping here is to ensure music doesn't become audible after exiting back to PlayerLoader.
|
// stopping here is to ensure music doesn't become audible after exiting back to PlayerLoader.
|
||||||
musicController.Stop();
|
musicController.Stop();
|
||||||
|
|
||||||
if (RestartRequested != null)
|
|
||||||
{
|
|
||||||
skipExitTransition = quickRestart;
|
skipExitTransition = quickRestart;
|
||||||
RestartRequested?.Invoke(quickRestart);
|
PrepareLoaderForRestart?.Invoke(quickRestart);
|
||||||
|
|
||||||
|
if (!this.IsCurrentScreen())
|
||||||
|
{
|
||||||
|
// if we're called externally (i.e. from results screen),
|
||||||
|
// use MakeCurrent to exit results screen as well as this player screen
|
||||||
|
// since ValidForResume = false in here
|
||||||
|
Debug.Assert(!ValidForResume);
|
||||||
|
this.MakeCurrent();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -457,7 +457,7 @@ namespace osu.Game.Screens.Play
|
|||||||
CurrentPlayer = createPlayer();
|
CurrentPlayer = createPlayer();
|
||||||
CurrentPlayer.Configuration.AutomaticallySkipIntro |= quickRestart;
|
CurrentPlayer.Configuration.AutomaticallySkipIntro |= quickRestart;
|
||||||
CurrentPlayer.RestartCount = restartCount++;
|
CurrentPlayer.RestartCount = restartCount++;
|
||||||
CurrentPlayer.RestartRequested = restartRequested;
|
CurrentPlayer.PrepareLoaderForRestart = prepareForRestart;
|
||||||
|
|
||||||
LoadTask = LoadComponentAsync(CurrentPlayer, _ =>
|
LoadTask = LoadComponentAsync(CurrentPlayer, _ =>
|
||||||
{
|
{
|
||||||
@ -470,13 +470,11 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private void restartRequested(bool quickRestartRequested)
|
private void prepareForRestart(bool quickRestartRequested)
|
||||||
{
|
{
|
||||||
quickRestart = quickRestartRequested;
|
quickRestart = quickRestartRequested;
|
||||||
hideOverlays = true;
|
hideOverlays = true;
|
||||||
ValidForResume = true;
|
ValidForResume = true;
|
||||||
|
|
||||||
this.MakeCurrent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void contentIn(double delayBeforeSideDisplays = 0)
|
private void contentIn(double delayBeforeSideDisplays = 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user