1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:07:52 +08:00

Add delayed resume for taiko/catch/mania

This commit is contained in:
Dan Balasescu 2024-02-08 02:16:08 +09:00
parent 7f3646f2d1
commit dcb195f3c8
No known key found for this signature in database
4 changed files with 41 additions and 0 deletions

View File

@ -16,6 +16,7 @@ using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.UI;
using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Scoring;
using osu.Game.Screens.Play;
namespace osu.Game.Rulesets.Catch.UI
{
@ -52,5 +53,7 @@ namespace osu.Game.Rulesets.Catch.UI
protected override PassThroughInputManager CreateInputManager() => new CatchInputManager(Ruleset.RulesetInfo);
public override DrawableHitObject<CatchHitObject>? CreateDrawableRepresentation(CatchHitObject h) => null;
protected override ResumeOverlay CreateResumeOverlay() => new DelayedResumeOverlay();
}
}

View File

@ -26,6 +26,7 @@ using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.UI;
using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Scoring;
using osu.Game.Screens.Play;
using osu.Game.Skinning;
namespace osu.Game.Rulesets.Mania.UI
@ -164,6 +165,8 @@ namespace osu.Game.Rulesets.Mania.UI
protected override ReplayRecorder CreateReplayRecorder(Score score) => new ManiaReplayRecorder(score);
protected override ResumeOverlay CreateResumeOverlay() => new DelayedResumeOverlay();
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);

View File

@ -22,6 +22,7 @@ using osu.Game.Rulesets.Timing;
using osu.Game.Rulesets.UI;
using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Scoring;
using osu.Game.Screens.Play;
using osu.Game.Skinning;
using osuTK;
@ -101,5 +102,7 @@ namespace osu.Game.Rulesets.Taiko.UI
protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new TaikoFramedReplayInputHandler(replay);
protected override ReplayRecorder CreateReplayRecorder(Score score) => new TaikoReplayRecorder(score);
protected override ResumeOverlay CreateResumeOverlay() => new DelayedResumeOverlay();
}
}

View File

@ -0,0 +1,32 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Localisation;
using osu.Framework.Threading;
namespace osu.Game.Screens.Play
{
/// <summary>
/// Simple <see cref="ResumeOverlay"/> that resumes after 800ms.
/// </summary>
public partial class DelayedResumeOverlay : ResumeOverlay
{
protected override LocalisableString Message => string.Empty;
private ScheduledDelegate? scheduledResume;
protected override void PopIn()
{
base.PopIn();
scheduledResume?.Cancel();
scheduledResume = Scheduler.AddDelayed(Resume, 800);
}
protected override void PopOut()
{
base.PopOut();
scheduledResume?.Cancel();
}
}
}