2020-09-24 17:18:34 +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.
|
|
|
|
|
|
2024-08-27 21:59:42 +08:00
|
|
|
|
using System;
|
2020-09-25 11:42:37 +08:00
|
|
|
|
using NUnit.Framework;
|
2020-09-24 17:18:34 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2022-07-12 01:18:50 +08:00
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
2020-09-24 17:18:34 +08:00
|
|
|
|
using osu.Game.Graphics.UserInterfaceV2;
|
2024-08-27 21:59:42 +08:00
|
|
|
|
using osu.Game.Overlays;
|
2022-07-12 01:18:50 +08:00
|
|
|
|
using osu.Game.Tests.Visual.UserInterface;
|
2020-09-24 17:18:34 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Settings
|
|
|
|
|
{
|
2022-07-12 01:18:50 +08:00
|
|
|
|
public partial class TestSceneFileSelector : ThemeComparisonTestScene
|
2020-09-24 17:18:34 +08:00
|
|
|
|
{
|
2024-08-27 21:59:42 +08:00
|
|
|
|
public TestSceneFileSelector()
|
|
|
|
|
: base(false)
|
|
|
|
|
{
|
|
|
|
|
}
|
2020-09-25 11:42:37 +08:00
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestJpgFilesOnly()
|
|
|
|
|
{
|
2022-07-12 01:18:50 +08:00
|
|
|
|
AddStep("create", () =>
|
|
|
|
|
{
|
2024-08-27 21:59:42 +08:00
|
|
|
|
var colourProvider = new OverlayColourProvider(OverlayColourScheme.Aquamarine);
|
|
|
|
|
|
|
|
|
|
ContentContainer.Child = new DependencyProvidingContainer
|
2022-07-12 01:18:50 +08:00
|
|
|
|
{
|
2024-08-27 21:59:42 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
CachedDependencies = new (Type, object)[]
|
2022-07-12 01:18:50 +08:00
|
|
|
|
{
|
2024-08-27 21:59:42 +08:00
|
|
|
|
(typeof(OverlayColourProvider), colourProvider)
|
2022-07-12 01:18:50 +08:00
|
|
|
|
},
|
2024-08-27 21:59:42 +08:00
|
|
|
|
Children = new Drawable[]
|
2022-07-12 01:18:50 +08:00
|
|
|
|
{
|
2024-08-27 21:59:42 +08:00
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Colour = colourProvider.Background3
|
|
|
|
|
},
|
|
|
|
|
new OsuFileSelector(validFileExtensions: new[] { ".jpg" })
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
},
|
|
|
|
|
}
|
2022-07-12 01:18:50 +08:00
|
|
|
|
};
|
|
|
|
|
});
|
2020-09-24 17:18:34 +08:00
|
|
|
|
}
|
2022-07-12 01:18:50 +08:00
|
|
|
|
|
|
|
|
|
protected override Drawable CreateContent() => new OsuFileSelector
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
};
|
2020-09-24 17:18:34 +08:00
|
|
|
|
}
|
|
|
|
|
}
|