Pass track from Player to components

This commit is contained in:
smoogipoo
2020-08-06 18:31:08 +09:00
parent 7c3ae4ed42
commit 2e3ecf71c7
6 changed files with 36 additions and 30 deletions

View File

@ -19,7 +19,12 @@ namespace osu.Game.Tests.Gameplay
{
GameplayClockContainer gcc = null;
AddStep("create container", () => Add(gcc = new GameplayClockContainer(CreateWorkingBeatmap(new OsuRuleset().RulesetInfo), Array.Empty<Mod>(), 0)));
AddStep("create container", () =>
{
var working = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);
Add(gcc = new GameplayClockContainer(working.GetRealTrack(), working, Array.Empty<Mod>(), 0));
});
AddStep("start track", () => gcc.Start());
AddUntilStep("elapsed greater than zero", () => gcc.GameplayClock.ElapsedFrameTime > 0);
}

View File

@ -59,7 +59,9 @@ namespace osu.Game.Tests.Gameplay
AddStep("create container", () =>
{
Add(gameplayContainer = new GameplayClockContainer(CreateWorkingBeatmap(new OsuRuleset().RulesetInfo), Array.Empty<Mod>(), 0));
var working = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);
Add(gameplayContainer = new GameplayClockContainer(working.GetRealTrack(), working, Array.Empty<Mod>(), 0));
gameplayContainer.Add(sample = new DrawableStoryboardSample(new StoryboardSampleInfo(string.Empty, 0, 1))
{
@ -103,7 +105,7 @@ namespace osu.Game.Tests.Gameplay
Beatmap.Value = new TestCustomSkinWorkingBeatmap(new OsuRuleset().RulesetInfo, Audio);
SelectedMods.Value = new[] { testedMod };
Add(gameplayContainer = new GameplayClockContainer(Beatmap.Value, SelectedMods.Value, 0));
Add(gameplayContainer = new GameplayClockContainer(MusicController.CurrentTrack, Beatmap.Value, SelectedMods.Value, 0));
gameplayContainer.Add(sample = new TestDrawableStoryboardSample(new StoryboardSampleInfo("test-sample", 1, 1))
{

View File

@ -32,7 +32,9 @@ namespace osu.Game.Tests.Visual.Gameplay
requestCount = 0;
increment = skip_time;
Child = gameplayClockContainer = new GameplayClockContainer(CreateWorkingBeatmap(CreateBeatmap(new OsuRuleset().RulesetInfo)), Array.Empty<Mod>(), 0)
var working = CreateWorkingBeatmap(CreateBeatmap(new OsuRuleset().RulesetInfo));
Child = gameplayClockContainer = new GameplayClockContainer(working.GetRealTrack(), working, Array.Empty<Mod>(), 0)
{
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]