Merge branch 'master' into profile-details-animation

This commit is contained in:
Dan Balasescu
2019-05-07 11:44:22 +09:00
committed by GitHub

View File

@ -38,6 +38,10 @@ namespace osu.Game.Screens.Play
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
protected override bool BlockPositionalInput => false; 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) public SkipOverlay(double startTime)
{ {
this.startTime = 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 const double fade_time = 300;
private double beginFadeTime => startTime - skip_required_cutoff - fade_time; private double beginFadeTime => startTime - fade_time;
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.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; Alpha = 0;
Expire(); Expire();
@ -107,7 +116,7 @@ namespace osu.Game.Screens.Play
using (BeginAbsoluteSequence(beginFadeTime)) using (BeginAbsoluteSequence(beginFadeTime))
this.FadeOut(fade_time); this.FadeOut(fade_time);
button.Action = () => RequestSeek?.Invoke(startTime - skip_required_cutoff - fade_time); button.Action = () => RequestSeek?.Invoke(beginFadeTime);
displayTime = Time.Current; displayTime = Time.Current;