1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:17:23 +08:00

Add proper resume request logic

This commit is contained in:
Dean Herbert 2019-03-21 16:57:40 +09:00
parent 8ad4009c33
commit a694626cc6

View File

@ -169,7 +169,20 @@ namespace osu.Game.Rulesets.UI
mod.ApplyToDrawableHitObjects(Playfield.HitObjectContainer.Objects);
}
public override void RequestResume(Action continueResume) => continueResume();
public override void RequestResume(Action continueResume)
{
if (ResumeOverlay != null && (Cursor == null || Contains(Cursor.ActiveCursor.ScreenSpaceDrawQuad.Centre)))
{
ResumeOverlay.ResumeAction = continueResume;
ResumeOverlay.Show();
}
else
continueResume();
}
public ResumeOverlay ResumeOverlay { get; private set; }
protected virtual ResumeOverlay CreateResumeOverlay() => null;
/// <summary>
/// Creates and adds the visual representation of a <see cref="TObject"/> to this <see cref="DrawableRuleset{TObject}"/>.