2021-07-06 06:20:58 +08:00
|
|
|
// 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.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2021-07-06 06:20:58 +08:00
|
|
|
using System.IO;
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Framework.Graphics.UserInterface;
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2021-07-21 21:01:00 +08:00
|
|
|
using osu.Game.Graphics.UserInterface;
|
2021-07-06 06:20:58 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Graphics.UserInterfaceV2
|
|
|
|
{
|
|
|
|
internal partial class OsuDirectorySelectorDirectory : DirectorySelectorDirectory
|
|
|
|
{
|
|
|
|
public OsuDirectorySelectorDirectory(DirectoryInfo directory, string displayName = null)
|
|
|
|
: base(directory, displayName)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2024-08-27 21:59:42 +08:00
|
|
|
private void load(OsuColour colours)
|
2021-07-06 06:20:58 +08:00
|
|
|
{
|
|
|
|
Flow.AutoSizeAxes = Axes.X;
|
|
|
|
Flow.Height = OsuDirectorySelector.ITEM_HEIGHT;
|
|
|
|
|
2021-07-21 21:01:00 +08:00
|
|
|
AddRangeInternal(new Drawable[]
|
2021-07-06 06:20:58 +08:00
|
|
|
{
|
2021-07-29 19:29:11 +08:00
|
|
|
new HoverClickSounds()
|
2021-07-06 06:20:58 +08:00
|
|
|
});
|
2024-08-27 21:59:42 +08:00
|
|
|
|
|
|
|
Colour = colours.Orange1;
|
2021-07-06 06:20:58 +08:00
|
|
|
}
|
|
|
|
|
2024-08-27 21:59:42 +08:00
|
|
|
protected override SpriteText CreateSpriteText() => new OsuSpriteText().With(t => t.Font = OsuFont.Default.With(weight: FontWeight.Bold));
|
2021-07-06 06:20:58 +08:00
|
|
|
|
|
|
|
protected override IconUsage? Icon => Directory.Name.Contains(Path.DirectorySeparatorChar)
|
|
|
|
? FontAwesome.Solid.Database
|
|
|
|
: FontAwesome.Regular.Folder;
|
|
|
|
}
|
|
|
|
}
|