mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Update tests
This commit is contained in:
@ -37,10 +37,22 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
|
|
||||||
public void SetContents(Func<Drawable> creationFunction)
|
public void SetContents(Func<Drawable> creationFunction)
|
||||||
{
|
{
|
||||||
Cell(0).Child = new LocalSkinOverrideContainer(null) { RelativeSizeAxes = Axes.Both }.WithChild(creationFunction());
|
Cell(0).Child = createProvider(null, creationFunction);
|
||||||
Cell(1).Child = new LocalSkinOverrideContainer(metricsSkin) { RelativeSizeAxes = Axes.Both }.WithChild(creationFunction());
|
Cell(1).Child = createProvider(metricsSkin, creationFunction);
|
||||||
Cell(2).Child = new LocalSkinOverrideContainer(defaultSkin) { RelativeSizeAxes = Axes.Both }.WithChild(creationFunction());
|
Cell(2).Child = createProvider(defaultSkin, creationFunction);
|
||||||
Cell(3).Child = new LocalSkinOverrideContainer(specialSkin) { RelativeSizeAxes = Axes.Both }.WithChild(creationFunction());
|
Cell(3).Child = createProvider(specialSkin, creationFunction);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Drawable createProvider(Skin skin, Func<Drawable> creationFunction)
|
||||||
|
{
|
||||||
|
var mainProvider = new SkinProvidingContainer(skin) { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
|
return mainProvider
|
||||||
|
.WithChild(new SkinProvidingContainer(Ruleset.Value.CreateInstance().CreateLegacySkinProvider(mainProvider))
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Child = creationFunction()
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestLegacySkin : LegacySkin
|
private class TestLegacySkin : LegacySkin
|
||||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
AddStep("setup layout larger source", () =>
|
AddStep("setup layout larger source", () =>
|
||||||
{
|
{
|
||||||
Child = new LocalSkinOverrideContainer(new SizedSource(50))
|
Child = new SkinProvidingContainer(new SizedSource(50))
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = fill = new FillFlowContainer<ExposedSkinnableDrawable>
|
Child = fill = new FillFlowContainer<ExposedSkinnableDrawable>
|
||||||
@ -59,7 +59,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
AddStep("setup layout larger source", () =>
|
AddStep("setup layout larger source", () =>
|
||||||
{
|
{
|
||||||
Child = new LocalSkinOverrideContainer(new SizedSource(30))
|
Child = new SkinProvidingContainer(new SizedSource(30))
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = fill = new FillFlowContainer<ExposedSkinnableDrawable>
|
Child = fill = new FillFlowContainer<ExposedSkinnableDrawable>
|
||||||
@ -95,7 +95,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
Child = new SkinSourceContainer
|
Child = new SkinSourceContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = new LocalSkinOverrideContainer(secondarySource)
|
Child = new SkinProvidingContainer(secondarySource)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = consumer = new SkinConsumer("test", name => new NamedBox("Default Implementation"), source => true)
|
Child = consumer = new SkinConsumer("test", name => new NamedBox("Default Implementation"), source => true)
|
||||||
@ -120,7 +120,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
Child = new SkinSourceContainer
|
Child = new SkinSourceContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = target = new LocalSkinOverrideContainer(secondarySource)
|
Child = target = new SkinProvidingContainer(secondarySource)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user