mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 05:53:10 +08:00
Fix lead-in time now being long enough in many cases
This commit is contained in:
parent
b69f61886c
commit
b967fe714b
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
using osu.Framework.Graphics.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
@ -46,6 +47,15 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
|
|
||||||
protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new OsuReplayInputHandler(replay);
|
protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new OsuReplayInputHandler(replay);
|
||||||
|
|
||||||
|
public override double GameplayStartTime
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var first = (OsuHitObject)Objects.First();
|
||||||
|
return first.StartTime - first.TimePreempt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override Vector2 GetAspectAdjustedSize()
|
protected override Vector2 GetAspectAdjustedSize()
|
||||||
{
|
{
|
||||||
var aspectSize = DrawSize.X * 0.75f < DrawSize.Y ? new Vector2(DrawSize.X, DrawSize.X * 0.75f) : new Vector2(DrawSize.Y * 4f / 3f, DrawSize.Y);
|
var aspectSize = DrawSize.X * 0.75f < DrawSize.Y ? new Vector2(DrawSize.X, DrawSize.X * 0.75f) : new Vector2(DrawSize.Y * 4f / 3f, DrawSize.Y);
|
||||||
|
@ -56,6 +56,12 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
public abstract IEnumerable<HitObject> Objects { get; }
|
public abstract IEnumerable<HitObject> Objects { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The point in time at which gameplay starts, including any required lead-in for display purposes.
|
||||||
|
/// Defaults to two seconds before the first <see cref="HitObject"/>. Override as necessary.
|
||||||
|
/// </summary>
|
||||||
|
public virtual double GameplayStartTime => Objects.First().StartTime - 2000;
|
||||||
|
|
||||||
private readonly Lazy<Playfield> playfield;
|
private readonly Lazy<Playfield> playfield;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -138,10 +138,9 @@ namespace osu.Game.Screens.Play
|
|||||||
sourceClock = (IAdjustableClock)working.Track ?? new StopwatchClock();
|
sourceClock = (IAdjustableClock)working.Track ?? new StopwatchClock();
|
||||||
adjustableClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
|
adjustableClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
|
||||||
|
|
||||||
var firstObjectTime = RulesetContainer.Objects.First().StartTime;
|
|
||||||
adjustableClock.Seek(AllowLeadIn
|
adjustableClock.Seek(AllowLeadIn
|
||||||
? Math.Min(0, firstObjectTime - Math.Max(beatmap.ControlPointInfo.TimingPointAt(firstObjectTime).BeatLength * 4, beatmap.BeatmapInfo.AudioLeadIn))
|
? Math.Min(RulesetContainer.GameplayStartTime, beatmap.HitObjects.First().StartTime - beatmap.BeatmapInfo.AudioLeadIn)
|
||||||
: firstObjectTime);
|
: RulesetContainer.GameplayStartTime);
|
||||||
|
|
||||||
adjustableClock.ProcessFrame();
|
adjustableClock.ProcessFrame();
|
||||||
|
|
||||||
@ -199,7 +198,7 @@ namespace osu.Game.Screens.Play
|
|||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
},
|
},
|
||||||
new SkipOverlay(firstObjectTime)
|
new SkipOverlay(RulesetContainer.GameplayStartTime)
|
||||||
{
|
{
|
||||||
Clock = Clock, // skip button doesn't want to use the audio clock directly
|
Clock = Clock, // skip button doesn't want to use the audio clock directly
|
||||||
ProcessCustomClock = false,
|
ProcessCustomClock = false,
|
||||||
|
Loading…
Reference in New Issue
Block a user