1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

Merge pull request #4710 from peppy/skip-matches-stable

Improve skip boundary logic to be closer to expectations
This commit is contained in:
Dan Balasescu 2019-05-07 11:05:14 +09:00 committed by GitHub
commit 437d7a5cf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,6 +38,10 @@ namespace osu.Game.Screens.Play
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
protected override bool BlockPositionalInput => false;
/// <summary>
/// Displays a skip overlay, giving the user the ability to skip forward.
/// </summary>
/// <param name="startTime">The time at which gameplay begins to appear.</param>
public SkipOverlay(double startTime)
{
this.startTime = startTime;
@ -87,16 +91,21 @@ namespace osu.Game.Screens.Play
};
}
private const double skip_required_cutoff = 3000;
/// <summary>
/// Duration before gameplay start time required before skip button displays.
/// </summary>
private const double skip_buffer = 1000;
private const double fade_time = 300;
private double beginFadeTime => startTime - skip_required_cutoff - fade_time;
private double beginFadeTime => startTime - fade_time;
protected override void LoadComplete()
{
base.LoadComplete();
if (startTime < skip_required_cutoff)
// skip is not required if there is no extra "empty" time to skip.
if (Clock.CurrentTime > beginFadeTime - skip_buffer)
{
Alpha = 0;
Expire();
@ -107,7 +116,7 @@ namespace osu.Game.Screens.Play
using (BeginAbsoluteSequence(beginFadeTime))
this.FadeOut(fade_time);
button.Action = () => RequestSeek?.Invoke(startTime - skip_required_cutoff - fade_time);
button.Action = () => RequestSeek?.Invoke(beginFadeTime);
displayTime = Time.Current;