1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 05:02:55 +08:00

Merge branch 'master' into fix-progress-notifications-close

This commit is contained in:
Dan Balasescu 2017-12-27 21:44:31 +09:00 committed by GitHub
commit d99c6db4a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 5 deletions

@ -1 +1 @@
Subproject commit b28d4ba82af0138d38ff8b3f4f3392d9d9068da9
Subproject commit 10cae790c6f1d559c326f9438958d0b012d61dc6

View File

@ -46,6 +46,8 @@ namespace osu.Game.Screens.Play
public bool HasFailed { get; private set; }
public bool AllowPause { get; set; } = true;
public bool AllowLeadIn { get; set; } = true;
public bool AllowResults { get; set; } = true;
public int RestartCount;
@ -136,7 +138,10 @@ namespace osu.Game.Screens.Play
decoupledClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
var firstObjectTime = RulesetContainer.Objects.First().StartTime;
decoupledClock.Seek(Math.Min(0, firstObjectTime - Math.Max(beatmap.ControlPointInfo.TimingPointAt(firstObjectTime).BeatLength * 4, beatmap.BeatmapInfo.AudioLeadIn)));
decoupledClock.Seek(AllowLeadIn
? Math.Min(0, firstObjectTime - Math.Max(beatmap.ControlPointInfo.TimingPointAt(firstObjectTime).BeatLength * 4, beatmap.BeatmapInfo.AudioLeadIn))
: firstObjectTime);
decoupledClock.ProcessFrame();
offsetClock = new FramedOffsetClock(decoupledClock);
@ -273,6 +278,8 @@ namespace osu.Game.Screens.Play
ValidForResume = false;
if (!AllowResults) return;
using (BeginDelayedSequence(1000))
{
onCompletionEvent = Schedule(delegate

View File

@ -19,6 +19,6 @@ namespace osu.Game.Tests.Beatmaps
protected override Beatmap GetBeatmap() => beatmap;
protected override Texture GetBackground() => null;
protected override Track GetTrack() => null;
protected override Track GetTrack() => new TrackVirtual();
}
}

View File

@ -22,6 +22,8 @@ namespace osu.Game.Tests.Visual
protected Player Player;
private TestWorkingBeatmap working;
/// <summary>
/// Create a TestCase which runs through the Player screen.
/// </summary>
@ -75,7 +77,7 @@ namespace osu.Game.Tests.Visual
var instance = r.CreateInstance();
WorkingBeatmap working = new TestWorkingBeatmap(beatmap);
working = new TestWorkingBeatmap(beatmap);
working.Mods.Value = new[] { instance.GetAllMods().First(m => m is ModNoFail) };
if (Player != null)
@ -88,10 +90,21 @@ namespace osu.Game.Tests.Visual
return player;
}
protected override void Update()
{
base.Update();
if (working != null)
// note that this will override any mod rate application
working.Track.Rate = Clock.Rate;
}
protected virtual Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) => new Player
{
InitialBeatmap = beatmap,
AllowPause = false
AllowPause = false,
AllowLeadIn = false,
AllowResults = false,
};
private const string test_beatmap_data =