mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 07:22:54 +08:00
Add UseResumeOverlay
and use it for hiding the ResumeOverlay
This commit is contained in:
parent
8b47af6503
commit
e4b84ebd0b
@ -54,14 +54,14 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
|
||||
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
|
||||
{
|
||||
drawableRuleset.ResumeOverlay = null;
|
||||
|
||||
// Grab the input manager to disable the user's cursor, and for future use
|
||||
inputManager = (OsuInputManager)drawableRuleset.KeyBindingInputManager;
|
||||
inputManager.AllowUserCursorMovement = false;
|
||||
|
||||
// Generate the replay frames the cursor should follow
|
||||
replayFrames = new OsuAutoGenerator(drawableRuleset.Beatmap, drawableRuleset.Mods).Generate().Frames.Cast<OsuReplayFrame>().ToList();
|
||||
|
||||
drawableRuleset.UseResumeOverlay = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -196,6 +196,8 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
if ((ResumeOverlay = CreateResumeOverlay()) != null)
|
||||
{
|
||||
UseResumeOverlay = true;
|
||||
|
||||
AddInternal(CreateInputManager()
|
||||
.WithChild(CreatePlayfieldAdjustmentContainer()
|
||||
.WithChild(ResumeOverlay)));
|
||||
@ -230,7 +232,7 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
public override void RequestResume(Action continueResume)
|
||||
{
|
||||
if (ResumeOverlay != null && (Cursor == null || (Cursor.LastFrameState == Visibility.Visible && Contains(Cursor.ActiveCursor.ScreenSpaceDrawQuad.Centre))))
|
||||
if (ResumeOverlay != null && UseResumeOverlay && (Cursor == null || (Cursor.LastFrameState == Visibility.Visible && Contains(Cursor.ActiveCursor.ScreenSpaceDrawQuad.Centre))))
|
||||
{
|
||||
ResumeOverlay.GameplayCursor = Cursor;
|
||||
ResumeOverlay.ResumeAction = continueResume;
|
||||
@ -507,6 +509,12 @@ namespace osu.Game.Rulesets.UI
|
||||
/// </summary>
|
||||
public ResumeOverlay ResumeOverlay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether the <see cref="ResumeOverlay"/> should be used to return the user's cursor position to its previous location after a pause.
|
||||
/// </summary>
|
||||
/// <remarks>Defaults to <c>true</c> if a ruleset returns a non-null overlay via <see cref="CreateResumeOverlay"/>.</remarks>
|
||||
public bool UseResumeOverlay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns first available <see cref="HitWindows"/> provided by a <see cref="HitObject"/>.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user