2021-12-02 13:01:18 +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.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2021-12-02 13:01:18 +08:00
|
|
|
using System.Linq;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Testing;
|
|
|
|
using osu.Game.Overlays.Settings.Sections;
|
2023-01-26 17:21:04 +08:00
|
|
|
using osu.Game.Overlays.SkinEditor;
|
2021-12-02 13:01:18 +08:00
|
|
|
using osu.Game.Skinning;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Navigation
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
public partial class TestSceneEditDefaultSkin : OsuGameTestScene
|
2021-12-02 13:01:18 +08:00
|
|
|
{
|
|
|
|
private SkinManager skinManager => Game.Dependencies.Get<SkinManager>();
|
|
|
|
private SkinEditorOverlay skinEditor => Game.Dependencies.Get<SkinEditorOverlay>();
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void TestEditDefaultSkin()
|
|
|
|
{
|
2022-09-27 20:55:03 +08:00
|
|
|
AddAssert("is default skin", () => skinManager.CurrentSkinInfo.Value.ID == SkinInfo.ARGON_SKIN);
|
2021-12-02 13:01:18 +08:00
|
|
|
|
|
|
|
AddStep("open settings", () => { Game.Settings.Show(); });
|
|
|
|
|
|
|
|
// Until step requires as settings has a delayed load.
|
|
|
|
AddUntilStep("export button disabled", () => Game.Settings.ChildrenOfType<SkinSection.ExportSkinButton>().SingleOrDefault()?.Enabled.Value == false);
|
|
|
|
|
|
|
|
// Will create a mutable skin.
|
|
|
|
AddStep("open skin editor", () => skinEditor.Show());
|
|
|
|
|
|
|
|
// Until step required as the skin editor may take time to load (and an extra scheduled frame for the mutable part).
|
2022-09-27 20:55:03 +08:00
|
|
|
AddUntilStep("is modified default skin", () => skinManager.CurrentSkinInfo.Value.ID != SkinInfo.ARGON_SKIN);
|
2021-12-02 13:01:18 +08:00
|
|
|
AddAssert("is not protected", () => skinManager.CurrentSkinInfo.Value.PerformRead(s => !s.Protected));
|
|
|
|
|
|
|
|
AddUntilStep("export button enabled", () => Game.Settings.ChildrenOfType<SkinSection.ExportSkinButton>().SingleOrDefault()?.Enabled.Value == true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|