1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 00:52:57 +08:00

Fix ResumeContainers appearing when resuming during breaks.

This commit is contained in:
DrabWeb 2019-04-07 16:32:55 -03:00
parent f2f60f6d03
commit e76897d6a7
2 changed files with 9 additions and 3 deletions

View File

@ -23,6 +23,8 @@ namespace osu.Game.Screens.Play
private readonly Container fadeContainer;
public bool IsActive { get; private set; }
public List<BreakPeriod> Breaks
{
get => breaks;
@ -125,6 +127,7 @@ namespace osu.Game.Screens.Play
using (BeginAbsoluteSequence(b.StartTime, true))
{
Schedule(() => IsActive = true);
fadeContainer.FadeIn(fade_duration);
breakArrows.Show(fade_duration);
@ -142,6 +145,7 @@ namespace osu.Game.Screens.Play
using (BeginDelayedSequence(b.Duration - fade_duration, true))
{
Schedule(() => IsActive = false);
fadeContainer.FadeOut(fade_duration);
breakArrows.Hide(fade_duration);
}

View File

@ -60,6 +60,8 @@ namespace osu.Game.Screens.Play
private SampleChannel sampleRestart;
private BreakOverlay breakOverlay;
protected ScoreProcessor ScoreProcessor { get; private set; }
protected DrawableRuleset DrawableRuleset { get; private set; }
@ -115,7 +117,7 @@ namespace osu.Game.Screens.Play
Child = DrawableRuleset
}
},
new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
breakOverlay = new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
@ -405,8 +407,8 @@ namespace osu.Game.Screens.Play
IsResuming = true;
PauseOverlay.Hide();
// time-based conditions may allow instant resume.
if (GameplayClockContainer.GameplayClock.CurrentTime < Beatmap.Value.Beatmap.HitObjects.First().StartTime)
// breaks and time-based conditions may allow instant resume.
if (breakOverlay.IsActive || GameplayClockContainer.GameplayClock.CurrentTime < Beatmap.Value.Beatmap.HitObjects.First().StartTime)
completeResume();
else
DrawableRuleset.RequestResume(completeResume);