mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 15:12:57 +08:00
Merge pull request #7873 from mcendu/remove-mania-skinnable-test
Make osu!mania's TestSceneDrawableJudgement use shared SkinnableTestScene
This commit is contained in:
commit
1bc649e6d9
@ -1,46 +0,0 @@
|
|||||||
// 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 System;
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Audio;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Game.Skinning;
|
|
||||||
using osu.Game.Tests.Visual;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania.Tests
|
|
||||||
{
|
|
||||||
public abstract class SkinnableTestScene : OsuGridTestScene
|
|
||||||
{
|
|
||||||
private Skin defaultSkin;
|
|
||||||
|
|
||||||
protected SkinnableTestScene()
|
|
||||||
: base(1, 2)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(AudioManager audio, SkinManager skinManager)
|
|
||||||
{
|
|
||||||
defaultSkin = skinManager.GetSkin(DefaultLegacySkin.Info);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetContents(Func<Drawable> creationFunction)
|
|
||||||
{
|
|
||||||
Cell(0).Child = createProvider(null, creationFunction);
|
|
||||||
Cell(1).Child = createProvider(defaultSkin, creationFunction);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Drawable createProvider(Skin skin, Func<Drawable> creationFunction)
|
|
||||||
{
|
|
||||||
var mainProvider = new SkinProvidingContainer(skin);
|
|
||||||
|
|
||||||
return mainProvider
|
|
||||||
.WithChild(new SkinProvidingContainer(Ruleset.Value.CreateInstance().CreateLegacySkinProvider(mainProvider))
|
|
||||||
{
|
|
||||||
Child = creationFunction()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Tests.Visual;
|
||||||
using osu.Game.Rulesets.Mania.UI;
|
using osu.Game.Rulesets.Mania.UI;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
|
Loading…
Reference in New Issue
Block a user