mirror of
https://github.com/osukey/osukey.git
synced 2025-06-20 02:38:04 +09:00
Add test showing all mod icons for reference
This commit is contained in:
parent
7ced84b7ef
commit
90fecbc9c7
@ -1,10 +1,10 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Rulesets.Osu;
|
using osu.Game.Rulesets.Osu;
|
||||||
using osu.Game.Rulesets.Osu.Mods;
|
using osu.Game.Rulesets.Osu.Mods;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
@ -13,10 +13,24 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
{
|
{
|
||||||
public class TestSceneModIcon : OsuTestScene
|
public class TestSceneModIcon : OsuTestScene
|
||||||
{
|
{
|
||||||
|
[Test]
|
||||||
|
public void TestShowAllMods()
|
||||||
|
{
|
||||||
|
AddStep("create mod icons", () =>
|
||||||
|
{
|
||||||
|
Child = new FillFlowContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Direction = FillDirection.Full,
|
||||||
|
ChildrenEnumerable = Ruleset.Value.CreateInstance().CreateAllMods().Select(m => new ModIcon(m)),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestChangeModType()
|
public void TestChangeModType()
|
||||||
{
|
{
|
||||||
ModIcon icon = null;
|
ModIcon icon = null!;
|
||||||
|
|
||||||
AddStep("create mod icon", () => Child = icon = new ModIcon(new OsuModDoubleTime()));
|
AddStep("create mod icon", () => Child = icon = new ModIcon(new OsuModDoubleTime()));
|
||||||
AddStep("change mod", () => icon.Mod = new OsuModEasy());
|
AddStep("change mod", () => icon.Mod = new OsuModEasy());
|
||||||
@ -25,7 +39,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestInterfaceModType()
|
public void TestInterfaceModType()
|
||||||
{
|
{
|
||||||
ModIcon icon = null;
|
ModIcon icon = null!;
|
||||||
|
|
||||||
var ruleset = new OsuRuleset();
|
var ruleset = new OsuRuleset();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user