mirror of
https://github.com/ppy/osu.git
synced 2026-05-18 07:09:53 +08:00
d27d0f40c1
Tests pass and seems to work. Need to do a bit more self-testing for higher confidence, but in theory.. Closes https://github.com/ppy/osu/issues/34035. --------- Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
62 lines
1.8 KiB
C#
62 lines
1.8 KiB
C#
// 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.Linq;
|
|
using NUnit.Framework;
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Graphics;
|
|
using osu.Game.Overlays;
|
|
using osu.Game.Overlays.Mods;
|
|
using osu.Game.Rulesets.Osu;
|
|
using osu.Game.Screens.OnlinePlay;
|
|
|
|
namespace osu.Game.Tests.Visual.Playlists
|
|
{
|
|
public partial class TestSceneFooterButtonFreeModsV2 : OsuTestScene
|
|
{
|
|
[Cached]
|
|
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Aquamarine);
|
|
|
|
private readonly FooterButtonFreeMods button;
|
|
|
|
public TestSceneFooterButtonFreeModsV2()
|
|
{
|
|
ModSelectOverlay modSelectOverlay;
|
|
Add(modSelectOverlay = new TestModSelectOverlay());
|
|
Add(button = new FooterButtonFreeMods(modSelectOverlay)
|
|
{
|
|
Anchor = Anchor.Centre,
|
|
Origin = Anchor.CentreLeft,
|
|
X = -100,
|
|
});
|
|
}
|
|
|
|
[Test]
|
|
public void TestAllMods()
|
|
{
|
|
AddStep("all mods", () => button.FreeMods.Value = new OsuRuleset().CreateAllMods().ToArray());
|
|
}
|
|
|
|
[Test]
|
|
public void TestNoMods()
|
|
{
|
|
AddStep("no mods", () => button.FreeMods.Value = []);
|
|
}
|
|
|
|
[Test]
|
|
public void TestFreestyle()
|
|
{
|
|
AddToggleStep("toggle freestyle", v => button.Freestyle.Value = v);
|
|
}
|
|
|
|
private partial class TestModSelectOverlay : UserModSelectOverlay
|
|
{
|
|
public TestModSelectOverlay()
|
|
: base(OverlayColourScheme.Aquamarine)
|
|
{
|
|
IsValidMod = _ => true;
|
|
}
|
|
}
|
|
}
|
|
}
|