2021-04-27 09:03:49 +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.
|
|
|
|
|
2021-04-29 04:53:01 +00:00
|
|
|
using NUnit.Framework;
|
2021-05-10 13:36:20 +00:00
|
|
|
using osu.Framework.Allocation;
|
2021-04-30 03:35:58 +00:00
|
|
|
using osu.Framework.Graphics;
|
2021-04-27 09:03:49 +00:00
|
|
|
using osu.Framework.Testing;
|
2021-04-28 06:14:48 +00:00
|
|
|
using osu.Game.Rulesets;
|
|
|
|
using osu.Game.Rulesets.Osu;
|
2021-05-10 13:36:20 +00:00
|
|
|
using osu.Game.Skinning;
|
2021-04-28 06:14:48 +00:00
|
|
|
using osu.Game.Skinning.Editor;
|
2021-04-27 09:03:49 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Gameplay
|
|
|
|
{
|
2021-04-29 04:53:01 +00:00
|
|
|
public class TestSceneSkinEditor : PlayerTestScene
|
2021-04-27 09:03:49 +00:00
|
|
|
{
|
2021-04-29 04:53:01 +00:00
|
|
|
private SkinEditor skinEditor;
|
|
|
|
|
2021-05-10 13:36:20 +00:00
|
|
|
[Resolved]
|
|
|
|
private SkinManager skinManager { get; set; }
|
|
|
|
|
2021-05-13 05:54:52 +00:00
|
|
|
protected override bool Autoplay => true;
|
|
|
|
|
2021-04-27 09:03:49 +00:00
|
|
|
[SetUpSteps]
|
2021-04-29 04:53:01 +00:00
|
|
|
public override void SetUpSteps()
|
2021-04-27 09:03:49 +00:00
|
|
|
{
|
2021-04-29 04:53:01 +00:00
|
|
|
base.SetUpSteps();
|
2021-04-27 09:03:49 +00:00
|
|
|
|
2021-05-10 13:36:20 +00:00
|
|
|
AddStep("reload skin editor", () =>
|
2021-04-29 04:53:01 +00:00
|
|
|
{
|
|
|
|
skinEditor?.Expire();
|
2021-05-06 05:17:30 +00:00
|
|
|
Player.ScaleTo(SkinEditorOverlay.VISIBLE_TARGET_SCALE);
|
2021-04-29 04:53:01 +00:00
|
|
|
LoadComponentAsync(skinEditor = new SkinEditor(Player), Add);
|
2021-04-27 09:03:49 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-04-29 04:53:01 +00:00
|
|
|
[Test]
|
|
|
|
public void TestToggleEditor()
|
|
|
|
{
|
|
|
|
AddToggleStep("toggle editor visibility", visible => skinEditor.ToggleVisibility());
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override Ruleset CreatePlayerRuleset() => new OsuRuleset();
|
2021-04-27 09:03:49 +00:00
|
|
|
}
|
|
|
|
}
|