mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Merge branch 'master' into dangerous-delete-actions
This commit is contained in:
commit
3ca365ad7f
@ -44,9 +44,6 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
|
||||
private BeatmapInfo beatmapInfo;
|
||||
|
||||
[Resolved]
|
||||
private RealmAccess realm { get; set; }
|
||||
|
||||
[Cached]
|
||||
private readonly DialogOverlay dialogOverlay;
|
||||
|
||||
@ -92,6 +89,12 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
dependencies.Cache(scoreManager = new ScoreManager(dependencies.Get<RulesetStore>(), () => beatmapManager, LocalStorage, Realm, Scheduler));
|
||||
Dependencies.Cache(Realm);
|
||||
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load() => Schedule(() =>
|
||||
{
|
||||
var imported = beatmapManager.Import(new ImportTask(TestResources.GetQuickTestBeatmapForImport())).GetResultSafely();
|
||||
|
||||
imported?.PerformRead(s =>
|
||||
@ -115,26 +118,26 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
importedScores.Add(scoreManager.Import(score).Value);
|
||||
}
|
||||
});
|
||||
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
[SetUp]
|
||||
public void Setup() => Schedule(() =>
|
||||
{
|
||||
realm.Run(r =>
|
||||
{
|
||||
// Due to soft deletions, we can re-use deleted scores between test runs
|
||||
scoreManager.Undelete(r.All<ScoreInfo>().Where(s => s.DeletePending).ToList());
|
||||
});
|
||||
|
||||
leaderboard.BeatmapInfo = beatmapInfo;
|
||||
leaderboard.RefetchScores(); // Required in the case that the beatmap hasn't changed
|
||||
});
|
||||
|
||||
[SetUpSteps]
|
||||
public void SetupSteps()
|
||||
{
|
||||
AddUntilStep("ensure scores imported", () => importedScores.Count == 50);
|
||||
AddStep("undelete scores", () =>
|
||||
{
|
||||
Realm.Run(r =>
|
||||
{
|
||||
// Due to soft deletions, we can re-use deleted scores between test runs
|
||||
scoreManager.Undelete(r.All<ScoreInfo>().Where(s => s.DeletePending).ToList());
|
||||
});
|
||||
});
|
||||
AddStep("set up leaderboard", () =>
|
||||
{
|
||||
leaderboard.BeatmapInfo = beatmapInfo;
|
||||
leaderboard.RefetchScores(); // Required in the case that the beatmap hasn't changed
|
||||
});
|
||||
|
||||
// Ensure the leaderboard items have finished showing up
|
||||
AddStep("finish transforms", () => leaderboard.FinishTransforms(true));
|
||||
AddUntilStep("wait for drawables", () => leaderboard.ChildrenOfType<LeaderboardScore>().Any());
|
||||
|
@ -174,7 +174,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public virtual bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||
{
|
||||
if (e.Action == Hotkey)
|
||||
if (e.Action == Hotkey && !e.Repeat)
|
||||
{
|
||||
TriggerClick();
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user