1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 04:02:59 +08:00

Fix a few more tests

This commit is contained in:
smoogipoo 2020-09-09 16:33:48 +09:00
parent b1b99e4d6f
commit 1a023d2c88
2 changed files with 25 additions and 19 deletions

View File

@ -3,6 +3,7 @@
using System.Linq;
using System.Threading.Tasks;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
@ -27,8 +28,8 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
private TriangleButton restoreButton;
private TriangleButton undeleteButton;
[BackgroundDependencyLoader]
private void load(BeatmapManager beatmaps, ScoreManager scores, SkinManager skins, CollectionManager collectionManager, DialogOverlay dialogOverlay)
[BackgroundDependencyLoader(permitNulls: true)]
private void load(BeatmapManager beatmaps, ScoreManager scores, SkinManager skins, [CanBeNull] CollectionManager collectionManager, DialogOverlay dialogOverlay)
{
if (beatmaps.SupportsImportFromStable)
{
@ -108,6 +109,8 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
}
});
if (collectionManager != null)
{
if (collectionManager.SupportsImportFromStable)
{
Add(importCollectionsButton = new SettingsButton
@ -129,6 +132,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
dialogOverlay?.Push(new DeleteAllBeatmapsDialog(collectionManager.DeleteAll));
}
});
}
AddRange(new Drawable[]
{

View File

@ -37,10 +37,12 @@ namespace osu.Game.Screens.Select
ItemSource = filters;
}
[BackgroundDependencyLoader]
private void load(CollectionManager collectionManager)
[BackgroundDependencyLoader(permitNulls: true)]
private void load([CanBeNull] CollectionManager collectionManager)
{
if (collectionManager != null)
collections.BindTo(collectionManager.Collections);
collections.CollectionChanged += (_, __) => collectionsChanged();
collectionsChanged();
}