mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Merge branch 'master' into legacy-skin-resource-improvements
This commit is contained in:
@ -3,6 +3,8 @@
|
||||
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Skinning;
|
||||
|
||||
@ -11,6 +13,8 @@ namespace osu.Game.Tests.Visual
|
||||
[TestFixture]
|
||||
public abstract class LegacySkinPlayerTestScene : PlayerTestScene
|
||||
{
|
||||
protected LegacySkin LegacySkin { get; private set; }
|
||||
|
||||
private ISkinSource legacySkinSource;
|
||||
|
||||
protected override TestPlayer CreatePlayer(Ruleset ruleset) => new SkinProvidingPlayer(legacySkinSource);
|
||||
@ -18,8 +22,31 @@ namespace osu.Game.Tests.Visual
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(SkinManager skins)
|
||||
{
|
||||
var legacySkin = new DefaultLegacySkin(skins);
|
||||
legacySkinSource = new SkinProvidingContainer(legacySkin);
|
||||
LegacySkin = new DefaultLegacySkin(skins);
|
||||
legacySkinSource = new SkinProvidingContainer(LegacySkin);
|
||||
}
|
||||
|
||||
[SetUpSteps]
|
||||
public override void SetUpSteps()
|
||||
{
|
||||
base.SetUpSteps();
|
||||
addResetTargetsStep();
|
||||
}
|
||||
|
||||
[TearDownSteps]
|
||||
public override void TearDownSteps()
|
||||
{
|
||||
addResetTargetsStep();
|
||||
base.TearDownSteps();
|
||||
}
|
||||
|
||||
private void addResetTargetsStep()
|
||||
{
|
||||
AddStep("reset targets", () => this.ChildrenOfType<SkinnableTargetContainer>().ForEach(t =>
|
||||
{
|
||||
LegacySkin.ResetDrawableTarget(t);
|
||||
t.Reload();
|
||||
}));
|
||||
}
|
||||
|
||||
public class SkinProvidingPlayer : TestPlayer
|
||||
|
Reference in New Issue
Block a user