2020-12-01 00:49:04 +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.
|
|
|
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.IO.Stores;
|
|
|
|
using osu.Game.Rulesets;
|
|
|
|
using osu.Game.Skinning;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual
|
|
|
|
{
|
|
|
|
[TestFixture]
|
|
|
|
public abstract class LegacySkinPlayerTestScene : PlayerTestScene
|
|
|
|
{
|
|
|
|
private ISkinSource legacySkinSource;
|
|
|
|
|
|
|
|
protected override TestPlayer CreatePlayer(Ruleset ruleset) => new SkinProvidingPlayer(legacySkinSource);
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2020-12-21 06:14:32 +00:00
|
|
|
private void load(OsuGameBase game, SkinManager skins)
|
2020-12-01 00:49:04 +00:00
|
|
|
{
|
2021-05-19 20:44:53 +00:00
|
|
|
var legacySkin = new DefaultLegacySkin(new NamespacedResourceStore<byte[]>(game.Resources, "Skins/Legacy"), skins);
|
|
|
|
legacySkinSource = new SkinProvidingContainer(legacySkin);
|
2020-12-01 00:49:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public class SkinProvidingPlayer : TestPlayer
|
|
|
|
{
|
|
|
|
[Cached(typeof(ISkinSource))]
|
|
|
|
private readonly ISkinSource skinSource;
|
|
|
|
|
|
|
|
public SkinProvidingPlayer(ISkinSource skinSource)
|
|
|
|
{
|
|
|
|
this.skinSource = skinSource;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|