2021-07-05 22:20:58 +00: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.
|
|
|
|
|
|
|
|
using System.IO;
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Framework.Graphics.UserInterface;
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2021-07-21 13:01:00 +00:00
|
|
|
using osu.Game.Graphics.UserInterface;
|
2021-07-05 22:20:58 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Graphics.UserInterfaceV2
|
|
|
|
{
|
|
|
|
internal class OsuDirectorySelectorDirectory : DirectorySelectorDirectory
|
|
|
|
{
|
|
|
|
public OsuDirectorySelectorDirectory(DirectoryInfo directory, string displayName = null)
|
|
|
|
: base(directory, displayName)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
|
|
|
Flow.AutoSizeAxes = Axes.X;
|
|
|
|
Flow.Height = OsuDirectorySelector.ITEM_HEIGHT;
|
|
|
|
|
2021-07-21 13:01:00 +00:00
|
|
|
AddRangeInternal(new Drawable[]
|
2021-07-05 22:20:58 +00:00
|
|
|
{
|
2021-07-21 13:01:00 +00:00
|
|
|
new Background
|
|
|
|
{
|
|
|
|
Depth = 1
|
|
|
|
},
|
2021-07-29 11:29:11 +00:00
|
|
|
new HoverClickSounds()
|
2021-07-05 22:20:58 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override SpriteText CreateSpriteText() => new OsuSpriteText();
|
|
|
|
|
|
|
|
protected override IconUsage? Icon => Directory.Name.Contains(Path.DirectorySeparatorChar)
|
|
|
|
? FontAwesome.Solid.Database
|
|
|
|
: FontAwesome.Regular.Folder;
|
|
|
|
|
|
|
|
internal class Background : CompositeDrawable
|
|
|
|
{
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
|
|
|
|
Masking = true;
|
|
|
|
CornerRadius = 5;
|
|
|
|
|
|
|
|
InternalChild = new Box
|
|
|
|
{
|
|
|
|
Colour = colours.GreySeafoamDarker,
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|