mirror of
https://github.com/ppy/osu
synced 2024-12-13 18:37:04 +00:00
Allow testbrowser's rate adjust to affect TestCasePlayer
This commit is contained in:
parent
9fb958eadc
commit
99a44e6d79
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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,6 +90,15 @@ 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,
|
||||
|
Loading…
Reference in New Issue
Block a user