1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-23 16:27:20 +08:00

Check for breaks using GameplayClock time.

This commit is contained in:
DrabWeb 2019-04-13 11:39:22 -03:00
parent e76897d6a7
commit c766631ad6
2 changed files with 4 additions and 8 deletions

View File

@ -23,8 +23,6 @@ namespace osu.Game.Screens.Play
private readonly Container fadeContainer;
public bool IsActive { get; private set; }
public List<BreakPeriod> Breaks
{
get => breaks;
@ -127,7 +125,6 @@ namespace osu.Game.Screens.Play
using (BeginAbsoluteSequence(b.StartTime, true))
{
Schedule(() => IsActive = true);
fadeContainer.FadeIn(fade_duration);
breakArrows.Show(fade_duration);
@ -145,7 +142,6 @@ 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,8 +60,6 @@ namespace osu.Game.Screens.Play
private SampleChannel sampleRestart;
private BreakOverlay breakOverlay;
protected ScoreProcessor ScoreProcessor { get; private set; }
protected DrawableRuleset DrawableRuleset { get; private set; }
@ -117,7 +115,7 @@ namespace osu.Game.Screens.Play
Child = DrawableRuleset
}
},
breakOverlay = new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
@ -408,7 +406,9 @@ namespace osu.Game.Screens.Play
PauseOverlay.Hide();
// breaks and time-based conditions may allow instant resume.
if (breakOverlay.IsActive || GameplayClockContainer.GameplayClock.CurrentTime < Beatmap.Value.Beatmap.HitObjects.First().StartTime)
double time = GameplayClockContainer.GameplayClock.CurrentTime;
if (Beatmap.Value.Beatmap.Breaks.Any(b => time >= b.StartTime && time <= b.EndTime) ||
time < Beatmap.Value.Beatmap.HitObjects.First().StartTime)
completeResume();
else
DrawableRuleset.RequestResume(completeResume);