1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-30 06:03:22 +08:00

Allow testbrowser's rate adjust to affect TestCasePlayer

This commit is contained in:
Dean Herbert 2017-12-26 15:02:01 +09:00
parent 9fb958eadc
commit 99a44e6d79
2 changed files with 13 additions and 2 deletions

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,6 +90,15 @@ 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,