mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Don’t allow ResumeContainers to appear during breaks (#4607)
Don’t allow ResumeContainers to appear during breaks Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
@ -29,5 +29,12 @@ namespace osu.Game.Beatmaps.Timing
|
|||||||
/// Whether the break has any effect. Breaks that are too short are culled before they are added to the beatmap.
|
/// Whether the break has any effect. Breaks that are too short are culled before they are added to the beatmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool HasEffect => Duration >= MIN_BREAK_DURATION;
|
public bool HasEffect => Duration >= MIN_BREAK_DURATION;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether this break contains a specified time.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="time">The time to check in milliseconds.</param>
|
||||||
|
/// <returns>Whether the time falls within this <see cref="BreakPeriod"/>.</returns>
|
||||||
|
public bool Contains(double time) => time >= StartTime && time <= EndTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -414,8 +414,9 @@ namespace osu.Game.Screens.Play
|
|||||||
IsResuming = true;
|
IsResuming = true;
|
||||||
PauseOverlay.Hide();
|
PauseOverlay.Hide();
|
||||||
|
|
||||||
// time-based conditions may allow instant resume.
|
// breaks and time-based conditions may allow instant resume.
|
||||||
if (GameplayClockContainer.GameplayClock.CurrentTime < Beatmap.Value.Beatmap.HitObjects.First().StartTime)
|
double time = GameplayClockContainer.GameplayClock.CurrentTime;
|
||||||
|
if (Beatmap.Value.Beatmap.Breaks.Any(b => b.Contains(time)) || time < Beatmap.Value.Beatmap.HitObjects.First().StartTime)
|
||||||
completeResume();
|
completeResume();
|
||||||
else
|
else
|
||||||
DrawableRuleset.RequestResume(completeResume);
|
DrawableRuleset.RequestResume(completeResume);
|
||||||
|
Reference in New Issue
Block a user