mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Tidy up various things everywhere
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
@ -11,6 +9,7 @@ using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osu.Game.Skinning;
|
||||
@ -20,18 +19,20 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
[TestFixture]
|
||||
public class TestSceneSongProgress : SkinnableHUDComponentTestScene
|
||||
{
|
||||
private DefaultSongProgress progress => this.ChildrenOfType<DefaultSongProgress>().Single();
|
||||
private GameplayClockContainer gameplayClockContainer;
|
||||
private const double gameplay_start_time = -2000;
|
||||
private GameplayClockContainer gameplayClockContainer = null!;
|
||||
|
||||
private const double skip_target_time = -2000;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
var working = CreateWorkingBeatmap(Ruleset.Value);
|
||||
working.LoadTrack();
|
||||
Add(gameplayClockContainer = new MasterGameplayClockContainer(working, gameplay_start_time));
|
||||
Dependencies.CacheAs(gameplayClockContainer);
|
||||
Dependencies.CacheAs(gameplayClockContainer.GameplayClock);
|
||||
Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);
|
||||
Beatmap.Value.LoadTrack();
|
||||
|
||||
Add(gameplayClockContainer = new MasterGameplayClockContainer(Beatmap.Value, skip_target_time));
|
||||
|
||||
Dependencies.CacheAs(gameplayClockContainer); // required for StartTime
|
||||
Dependencies.CacheAs(gameplayClockContainer.GameplayClock); // required for everything else
|
||||
}
|
||||
|
||||
[SetUpSteps]
|
||||
@ -44,7 +45,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
[Test]
|
||||
public void TestDisplay()
|
||||
{
|
||||
AddStep("seek to intro", () => gameplayClockContainer.Seek(gameplay_start_time));
|
||||
AddStep("seek to intro", () => gameplayClockContainer.Seek(skip_target_time));
|
||||
AddStep("start", gameplayClockContainer.Start);
|
||||
AddStep("stop", gameplayClockContainer.Stop);
|
||||
}
|
||||
@ -52,11 +53,13 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
[Test]
|
||||
public void TestToggleSeeking()
|
||||
{
|
||||
AddStep("allow seeking", () => progress.AllowSeeking.Value = true);
|
||||
AddStep("hide graph", () => progress.ShowGraph.Value = false);
|
||||
AddStep("disallow seeking", () => progress.AllowSeeking.Value = false);
|
||||
AddStep("allow seeking", () => progress.AllowSeeking.Value = true);
|
||||
AddStep("show graph", () => progress.ShowGraph.Value = true);
|
||||
DefaultSongProgress getDefaultProgress() => this.ChildrenOfType<DefaultSongProgress>().Single();
|
||||
|
||||
AddStep("allow seeking", () => getDefaultProgress().AllowSeeking.Value = true);
|
||||
AddStep("hide graph", () => getDefaultProgress().ShowGraph.Value = false);
|
||||
AddStep("disallow seeking", () => getDefaultProgress().AllowSeeking.Value = false);
|
||||
AddStep("allow seeking", () => getDefaultProgress().AllowSeeking.Value = true);
|
||||
AddStep("show graph", () => getDefaultProgress().ShowGraph.Value = true);
|
||||
}
|
||||
|
||||
private void setHitObjects()
|
||||
|
Reference in New Issue
Block a user