Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show results immediately if user hits "back" key after finishing gameplay #25097

Merged
merged 7 commits into from
Oct 13, 2023

Conversation

peppy
Copy link
Member

@peppy peppy commented Oct 12, 2023

Closes #18089.

I've gone ahead and matched the osu!stable behaviour for this, as it seems like it's what people are used to and they will settle for no less.

@bdach
Copy link
Collaborator

bdach commented Oct 12, 2023

Two things:

First one, minor. With this change, do we still need the following code? It's not being removed in this pull.

// there is a chance that an exit request occurs after the transition to results has already started.
// even in such a case, the user has shown intent, so forcefully return to this screen (to proceed with the upwards exit process).
if (!this.IsCurrentScreen())
{
ValidForResume = false;
// in the potential case that this instance has already been exited, this is required to avoid a crash.
if (this.GetChildScreen() != null)
this.MakeCurrent();
return;
}

I can't actually hit this path but it seems like it could be removable (just do nothing if screen isn't current).

Second, probably more important. If a storyboard has an outro, exiting during outro will not progress to results due to:

// If the current beatmap has a storyboard, this method will be called again on storyboard completion.
// Alternatively, the user may press the outro skip button, forcing immediate display of the results screen.
if (storyboardStillRunning)
{
skipOutroOverlay.Show();
return;
}

I haven't checked what stable does but the fact that skipping outro will get you to results but exiting kicks to song select feels quite bad regardless.

@peppy
Copy link
Member Author

peppy commented Oct 12, 2023

With this change, do we still need the following code?

Likely not. I noticed this but forgot to check whether it can be removed.

If a storyboard has an outro, exiting during outro will not progress to results due to..

Should definitely use the new behaviour instead.

@@ -660,10 +671,10 @@ protected void SetGameplayStartTime(double time)
/// <remarks>This can be called from a child screen in order to trigger the restart process.</remarks>
/// </summary>
/// <param name="quickRestart">Whether a quick restart was requested (skipping intro etc.).</param>
public void Restart(bool quickRestart = false)
public bool Restart(bool quickRestart = false)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for a nitpick:
also need to add /// <returns> doc like for PerformExit?

@pull-request-size pull-request-size bot added size/L and removed size/M labels Oct 12, 2023
@peppy
Copy link
Member Author

peppy commented Oct 12, 2023

I can't actually hit this path but it seems like it could be removable (just do nothing if screen isn't current).

It can be removed, but requires some (probably fine) changes to the restart process, which may add a bit of mental burden to the review process (see d174a6c).

Second, probably more important. If a storyboard has an outro, exiting during outro will not progress to results

Have fixed this, a very easy fix luckily. It even had test coverage.

@peppy peppy force-pushed the results-screen-progress-fast branch from e9db2c1 to fa47309 Compare October 12, 2023 10:35
Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is okay, but leaning heavily on tests passing here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Player should not be able to exit gameplay after progression to results has begun
3 participants