Ensure the correct (up-to-date) ruleset is retrieved

This commit is contained in:
Dean Herbert 2020-04-07 16:18:24 +09:00
parent 2c840c52a3
commit 0a340bac5a
4 changed files with 11 additions and 1 deletions

View File

@ -15,5 +15,7 @@ public abstract class CatchSkinnableTestScene : SkinnableTestScene
typeof(CatchRuleset),
typeof(CatchLegacySkinTransformer),
};
protected override Ruleset CreateRulesetForSkinProvider() => new CatchRuleset();
}
}

View File

@ -33,6 +33,8 @@ public abstract class ManiaSkinnableTestScene : SkinnableTestScene
typeof(ManiaLegacySkinTransformer),
};
protected override Ruleset CreateRulesetForSkinProvider() => new ManiaRuleset();
protected ManiaSkinnableTestScene()
{
scrollingInfo.Direction.Value = ScrollingDirection.Down;

View File

@ -15,5 +15,7 @@ public abstract class OsuSkinnableTestScene : SkinnableTestScene
typeof(OsuRuleset),
typeof(OsuLegacySkinTransformer),
};
protected override Ruleset CreateRulesetForSkinProvider() => new OsuRuleset();
}
}

View File

@ -13,6 +13,7 @@
using osu.Framework.IO.Stores;
using osu.Game.Beatmaps;
using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets;
using osu.Game.Skinning;
using osuTK;
using osuTK.Graphics;
@ -34,6 +35,9 @@ protected SkinnableTestScene()
{
}
// Required to be part of the per-ruleset implementation to construct the newer version of the Ruleset.
protected abstract Ruleset CreateRulesetForSkinProvider();
[BackgroundDependencyLoader]
private void load(AudioManager audio, SkinManager skinManager)
{
@ -106,7 +110,7 @@ private Drawable createProvider(Skin skin, Func<Drawable> creationFunction, IBea
{
new OutlineBox { Alpha = autoSize ? 1 : 0 },
mainProvider.WithChild(
new SkinProvidingContainer(Ruleset.Value.CreateInstance().CreateLegacySkinProvider(mainProvider, beatmap))
new SkinProvidingContainer(CreateRulesetForSkinProvider().CreateLegacySkinProvider(mainProvider, beatmap))
{
Child = created,
RelativeSizeAxes = !autoSize ? Axes.Both : Axes.None,