1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-30 15:32:59 +08:00

Apply NRT to directory & file selectors

This commit is contained in:
Bartłomiej Dach 2024-08-27 16:01:49 +02:00
parent 7f8b64bb6d
commit 16fc413a4a
No known key found for this signature in database
4 changed files with 9 additions and 16 deletions

View File

@ -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.IO;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@ -20,7 +18,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
private Box hiddenToggleBackground = null!;
public OsuDirectorySelector(string initialPath = null)
public OsuDirectorySelector(string? initialPath = null)
: base(initialPath)
{
}
@ -68,7 +66,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
protected override DirectorySelectorDirectory CreateParentDirectoryItem(DirectoryInfo directory) => new OsuDirectorySelectorParentDirectory(directory);
protected override DirectorySelectorDirectory CreateDirectoryItem(DirectoryInfo directory, string displayName = null) => new OsuDirectorySelectorDirectory(directory, displayName);
protected override DirectorySelectorDirectory CreateDirectoryItem(DirectoryInfo directory, string? displayName = null) => new OsuDirectorySelectorDirectory(directory, displayName);
protected override void NotifySelectionError() => this.FlashColour(Colour4.Red, 300);
}

View File

@ -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.IO;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@ -31,7 +29,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
protected override DirectorySelectorDirectory CreateRootDirectoryItem() => new OsuBreadcrumbDisplayComputer();
protected override DirectorySelectorDirectory CreateDirectoryItem(DirectoryInfo directory, string displayName = null) => new OsuBreadcrumbDisplayDirectory(directory, displayName);
protected override DirectorySelectorDirectory CreateDirectoryItem(DirectoryInfo directory, string? displayName = null) => new OsuBreadcrumbDisplayDirectory(directory, displayName);
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
@ -62,13 +60,13 @@ namespace osu.Game.Graphics.UserInterfaceV2
private partial class OsuBreadcrumbDisplayDirectory : DirectorySelectorDirectory
{
public OsuBreadcrumbDisplayDirectory(DirectoryInfo directory, string displayName = null)
public OsuBreadcrumbDisplayDirectory(DirectoryInfo? directory, string? displayName = null)
: base(directory, displayName)
{
}
[Resolved]
private OverlayColourProvider colourProvider { get; set; }
private OverlayColourProvider colourProvider { get; set; } = null!;
[BackgroundDependencyLoader]
private void load()

View File

@ -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.IO;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@ -15,7 +13,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
{
internal partial class OsuDirectorySelectorDirectory : DirectorySelectorDirectory
{
public OsuDirectorySelectorDirectory(DirectoryInfo directory, string displayName = null)
public OsuDirectorySelectorDirectory(DirectoryInfo directory, string? displayName = null)
: base(directory, displayName)
{
}

View File

@ -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.IO;
using System.Linq;
using osu.Framework.Allocation;
@ -22,7 +20,8 @@ namespace osu.Game.Graphics.UserInterfaceV2
{
private Box hiddenToggleBackground = null!;
public OsuFileSelector(string initialPath = null, string[] validFileExtensions = null)
public OsuFileSelector(string? initialPath = null, string[]? validFileExtensions = null)
: base(initialPath, validFileExtensions)
{
}
@ -69,7 +68,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
protected override DirectorySelectorDirectory CreateParentDirectoryItem(DirectoryInfo directory) => new OsuDirectorySelectorParentDirectory(directory);
protected override DirectorySelectorDirectory CreateDirectoryItem(DirectoryInfo directory, string displayName = null) => new OsuDirectorySelectorDirectory(directory, displayName);
protected override DirectorySelectorDirectory CreateDirectoryItem(DirectoryInfo directory, string? displayName = null) => new OsuDirectorySelectorDirectory(directory, displayName);
protected override DirectoryListingFile CreateFileItem(FileInfo file) => new OsuDirectoryListingFile(file);