1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 22:03:21 +08:00

Merge remote-tracking branch 'origin/master' into editor-hitobject-movement

This commit is contained in:
smoogipoo 2018-02-14 14:08:36 +09:00
commit fcbeb97a54
3 changed files with 18 additions and 4 deletions

View File

@ -20,7 +20,15 @@ namespace osu.Game.Beatmaps
public float DrainRate { get; set; } = DEFAULT_DIFFICULTY; public float DrainRate { get; set; } = DEFAULT_DIFFICULTY;
public float CircleSize { get; set; } = DEFAULT_DIFFICULTY; public float CircleSize { get; set; } = DEFAULT_DIFFICULTY;
public float OverallDifficulty { get; set; } = DEFAULT_DIFFICULTY; public float OverallDifficulty { get; set; } = DEFAULT_DIFFICULTY;
public float ApproachRate { get; set; } = DEFAULT_DIFFICULTY;
private float? approachRate;
public float ApproachRate
{
get => approachRate ?? OverallDifficulty;
set => approachRate = value;
}
public float SliderMultiplier { get; set; } = 1; public float SliderMultiplier { get; set; } = 1;
public float SliderTickRate { get; set; } = 1; public float SliderTickRate { get; set; } = 1;

View File

@ -36,6 +36,7 @@ namespace osu.Game.Screens.Play
public int Retries { set { pauseOverlay.Retries = value; } } public int Retries { set { pauseOverlay.Retries = value; } }
public bool CanPause => (CheckCanPause?.Invoke() ?? true) && Time.Current >= lastPauseActionTime + pause_cooldown; public bool CanPause => (CheckCanPause?.Invoke() ?? true) && Time.Current >= lastPauseActionTime + pause_cooldown;
public bool IsResuming { get; private set; }
public Action OnRetry; public Action OnRetry;
public Action OnQuit; public Action OnQuit;
@ -54,7 +55,11 @@ namespace osu.Game.Screens.Play
AddInternal(pauseOverlay = new PauseOverlay AddInternal(pauseOverlay = new PauseOverlay
{ {
OnResume = () => this.Delay(400).Schedule(Resume), OnResume = () =>
{
IsResuming = true;
this.Delay(400).Schedule(Resume);
},
OnRetry = () => OnRetry(), OnRetry = () => OnRetry(),
OnQuit = () => OnQuit(), OnQuit = () => OnQuit(),
}); });
@ -100,6 +105,7 @@ namespace osu.Game.Screens.Play
pauseOverlay.Hide(); pauseOverlay.Hide();
AudioClock.Start(); AudioClock.Start();
IsResuming = false;
} }
private OsuGameBase game; private OsuGameBase game;

View File

@ -351,7 +351,7 @@ namespace osu.Game.Screens.Play
protected override bool OnExiting(Screen next) protected override bool OnExiting(Screen next)
{ {
if (!AllowPause || HasFailed || !ValidForResume || pauseContainer?.IsPaused != false || RulesetContainer?.HasReplayLoaded != false) if ((!AllowPause || HasFailed || !ValidForResume || pauseContainer?.IsPaused != false || RulesetContainer?.HasReplayLoaded != false) && (!pauseContainer?.IsResuming ?? false))
{ {
// In the case of replays, we may have changed the playback rate. // In the case of replays, we may have changed the playback rate.
applyRateFromMods(); applyRateFromMods();
@ -362,7 +362,7 @@ namespace osu.Game.Screens.Play
if (loadedSuccessfully) if (loadedSuccessfully)
{ {
pauseContainer.Pause(); pauseContainer?.Pause();
} }
return true; return true;