mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Check for breaks using GameplayClock time.
This commit is contained in:
parent
e76897d6a7
commit
c766631ad6
@ -23,8 +23,6 @@ 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;
|
||||||
@ -127,7 +125,6 @@ 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);
|
||||||
|
|
||||||
@ -145,7 +142,6 @@ 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);
|
||||||
}
|
}
|
||||||
|
@ -60,8 +60,6 @@ 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; }
|
||||||
|
|
||||||
@ -117,7 +115,7 @@ namespace osu.Game.Screens.Play
|
|||||||
Child = DrawableRuleset
|
Child = DrawableRuleset
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
breakOverlay = new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
|
new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
@ -408,7 +406,9 @@ namespace osu.Game.Screens.Play
|
|||||||
PauseOverlay.Hide();
|
PauseOverlay.Hide();
|
||||||
|
|
||||||
// breaks and time-based conditions may allow instant resume.
|
// 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();
|
completeResume();
|
||||||
else
|
else
|
||||||
DrawableRuleset.RequestResume(completeResume);
|
DrawableRuleset.RequestResume(completeResume);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user