mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 11:12:54 +08:00
Add skin traget resetting on setup/teardown steps
This commit is contained in:
parent
60b781701f
commit
d12e93bfc6
@ -3,7 +3,9 @@
|
||||
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.IO.Stores;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Skinning;
|
||||
|
||||
@ -25,6 +27,29 @@ namespace osu.Game.Tests.Visual
|
||||
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
|
||||
{
|
||||
[Cached(typeof(ISkinSource))]
|
||||
|
Loading…
Reference in New Issue
Block a user