1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 10:02:59 +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; private readonly Container fadeContainer;
public bool IsActive { get; private set; }
public List<BreakPeriod> Breaks public List<BreakPeriod> Breaks
{ {
get => breaks; get => breaks;
@ -125,6 +127,7 @@ namespace osu.Game.Screens.Play
using (BeginAbsoluteSequence(b.StartTime, true)) using (BeginAbsoluteSequence(b.StartTime, true))
{ {
Schedule(() => IsActive = true);
fadeContainer.FadeIn(fade_duration); fadeContainer.FadeIn(fade_duration);
breakArrows.Show(fade_duration); breakArrows.Show(fade_duration);
@ -142,6 +145,7 @@ namespace osu.Game.Screens.Play
using (BeginDelayedSequence(b.Duration - fade_duration, true)) using (BeginDelayedSequence(b.Duration - fade_duration, true))
{ {
Schedule(() => IsActive = false);
fadeContainer.FadeOut(fade_duration); fadeContainer.FadeOut(fade_duration);
breakArrows.Hide(fade_duration); breakArrows.Hide(fade_duration);
} }

View File

@ -60,6 +60,8 @@ namespace osu.Game.Screens.Play
private SampleChannel sampleRestart; private SampleChannel sampleRestart;
private BreakOverlay breakOverlay;
protected ScoreProcessor ScoreProcessor { get; private set; } protected ScoreProcessor ScoreProcessor { get; private set; }
protected DrawableRuleset DrawableRuleset { get; private set; } protected DrawableRuleset DrawableRuleset { get; private set; }
@ -115,7 +117,7 @@ namespace osu.Game.Screens.Play
Child = DrawableRuleset Child = DrawableRuleset
} }
}, },
new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor) breakOverlay = new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
@ -405,8 +407,8 @@ 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) if (breakOverlay.IsActive || GameplayClockContainer.GameplayClock.CurrentTime < Beatmap.Value.Beatmap.HitObjects.First().StartTime)
completeResume(); completeResume();
else else
DrawableRuleset.RequestResume(completeResume); DrawableRuleset.RequestResume(completeResume);