Skip to content

Commit

Permalink
Apply NRT to directory & file selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
bdach committed Sep 24, 2024
1 parent 7f8b64b commit 16fc413
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
6 changes: 2 additions & 4 deletions osu.Game/Graphics/UserInterfaceV2/OsuDirectorySelector.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -20,7 +18,7 @@ public partial class OsuDirectorySelector : DirectorySelector

private Box hiddenToggleBackground = null!;

public OsuDirectorySelector(string initialPath = null)
public OsuDirectorySelector(string? initialPath = null)
: base(initialPath)
{
}
Expand Down Expand Up @@ -68,7 +66,7 @@ private void load(OverlayColourProvider colourProvider)

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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -31,7 +29,7 @@ protected override Drawable CreateCaption() => Empty().With(d =>

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)
Expand Down Expand Up @@ -62,13 +60,13 @@ public OsuBreadcrumbDisplayComputer()

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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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)
{
}
Expand Down
7 changes: 3 additions & 4 deletions osu.Game/Graphics/UserInterfaceV2/OsuFileSelector.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -22,7 +20,8 @@ public partial class OsuFileSelector : FileSelector
{
private Box hiddenToggleBackground = null!;

public OsuFileSelector(string initialPath = null, string[] validFileExtensions = null)
public OsuFileSelector(string? initialPath = null, string[]? validFileExtensions = null)
: base(initialPath, validFileExtensions)
{
}

Expand Down Expand Up @@ -69,7 +68,7 @@ private void load(OverlayColourProvider colourProvider)

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);

Expand Down

0 comments on commit 16fc413

Please sign in to comment.