Merge branch 'master' into proper-taiko-hitsounds

This commit is contained in:
Dean Herbert 2017-12-27 21:45:20 +09:00 committed by GitHub
commit f68bf2e258
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 HasFailed { get; private set; }
public bool AllowPause { get; set; } = true; public bool AllowPause { get; set; } = true;
public bool AllowLeadIn { get; set; } = true;
public bool AllowResults { get; set; } = true;
public int RestartCount; public int RestartCount;
@ -136,7 +138,10 @@ namespace osu.Game.Screens.Play
decoupledClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false }; decoupledClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
var firstObjectTime = RulesetContainer.Objects.First().StartTime; 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(); decoupledClock.ProcessFrame();
offsetClock = new FramedOffsetClock(decoupledClock); offsetClock = new FramedOffsetClock(decoupledClock);
@ -273,6 +278,8 @@ namespace osu.Game.Screens.Play
ValidForResume = false; ValidForResume = false;
if (!AllowResults) return;
using (BeginDelayedSequence(1000)) using (BeginDelayedSequence(1000))
{ {
onCompletionEvent = Schedule(delegate onCompletionEvent = Schedule(delegate

View File

@ -19,6 +19,6 @@ namespace osu.Game.Tests.Beatmaps
protected override Beatmap GetBeatmap() => beatmap; protected override Beatmap GetBeatmap() => beatmap;
protected override Texture GetBackground() => null; 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; protected Player Player;
private TestWorkingBeatmap working;
/// <summary> /// <summary>
/// Create a TestCase which runs through the Player screen. /// Create a TestCase which runs through the Player screen.
/// </summary> /// </summary>
@ -75,7 +77,7 @@ namespace osu.Game.Tests.Visual
var instance = r.CreateInstance(); var instance = r.CreateInstance();
WorkingBeatmap working = new TestWorkingBeatmap(beatmap); working = new TestWorkingBeatmap(beatmap);
working.Mods.Value = new[] { instance.GetAllMods().First(m => m is ModNoFail) }; working.Mods.Value = new[] { instance.GetAllMods().First(m => m is ModNoFail) };
if (Player != null) if (Player != null)
@ -88,10 +90,21 @@ namespace osu.Game.Tests.Visual
return player; 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 protected virtual Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) => new Player
{ {
InitialBeatmap = beatmap, InitialBeatmap = beatmap,
AllowPause = false AllowPause = false,
AllowLeadIn = false,
AllowResults = false,
}; };
private const string test_beatmap_data = private const string test_beatmap_data =