Make processors and break overlay frame-stable

This commit is contained in:
smoogipoo
2019-12-25 14:35:32 +09:00
parent 85c44b5a5a
commit 977fb3d1bf
4 changed files with 34 additions and 36 deletions

View File

@ -208,12 +208,6 @@ namespace osu.Game.Screens.Play
{
target.AddRange(new[]
{
BreakOverlay = new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, DrawableRuleset.GameplayStartTime, ScoreProcessor)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Breaks = working.Beatmap.Breaks
},
// display the cursor above some HUD elements.
DrawableRuleset.Cursor?.CreateProxy() ?? new Container(),
DrawableRuleset.ResumeOverlay?.CreateProxy() ?? new Container(),
@ -268,6 +262,16 @@ namespace osu.Game.Screens.Play
},
failAnimation = new FailAnimation(DrawableRuleset) { OnComplete = onFailComplete, }
});
DrawableRuleset.Overlays.Add(BreakOverlay = new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, DrawableRuleset.GameplayStartTime, ScoreProcessor)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Breaks = working.Beatmap.Breaks
});
DrawableRuleset.Overlays.Add(ScoreProcessor);
DrawableRuleset.Overlays.Add(HealthProcessor);
}
private void updatePauseOnFocusLostState() =>
@ -342,14 +346,6 @@ namespace osu.Game.Screens.Play
this.Exit();
}
protected override void Update()
{
base.Update();
if (!GameplayClockContainer.IsPaused.Value)
HealthProcessor.ApplyElapsedTime(GameplayClockContainer.GameplayClock.ElapsedFrameTime);
}
/// <summary>
/// Restart gameplay via a parent <see cref="PlayerLoader"/>.
/// <remarks>This can be called from a child screen in order to trigger the restart process.</remarks>