Update Legacy components to not require skin in ctor

This commit is contained in:
Dean Herbert
2021-05-10 22:36:20 +09:00
parent b54eb56169
commit 004798d61d
12 changed files with 68 additions and 46 deletions

View File

@ -2,10 +2,12 @@
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Testing;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu;
using osu.Game.Skinning;
using osu.Game.Skinning.Editor;
namespace osu.Game.Tests.Visual.Gameplay
@ -14,12 +16,22 @@ namespace osu.Game.Tests.Visual.Gameplay
{
private SkinEditor skinEditor;
[Resolved]
private SkinManager skinManager { get; set; }
[SetUpSteps]
public override void SetUpSteps()
{
AddStep("set empty legacy skin", () =>
{
var imported = skinManager.Import(new SkinInfo { Name = "test skin" }).Result;
skinManager.CurrentSkinInfo.Value = imported;
});
base.SetUpSteps();
AddStep("add editor overlay", () =>
AddStep("reload skin editor", () =>
{
skinEditor?.Expire();
Player.ScaleTo(SkinEditorOverlay.VISIBLE_TARGET_SCALE);