mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 00:33:22 +08:00
Make TestCasePlayer more usable
No results screen crash, no unnecessary leadin time.
This commit is contained in:
parent
07d753441d
commit
9fb958eadc
@ -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
|
||||||
|
@ -91,7 +91,9 @@ namespace osu.Game.Tests.Visual
|
|||||||
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 =
|
||||||
|
Loading…
Reference in New Issue
Block a user