Merge branch 'master' into multi-pagination

This commit is contained in:
Dean Herbert
2020-07-31 22:41:24 +09:00
committed by GitHub
43 changed files with 544 additions and 232 deletions

View File

@ -67,9 +67,11 @@ namespace osu.Game.Tests.Gameplay
/// Tests that a hitobject which provides a custom sample set of 2 retrieves the following samples from the beatmap skin:
/// normal-hitnormal2
/// normal-hitnormal
/// hitnormal
/// </summary>
[TestCase("normal-hitnormal2")]
[TestCase("normal-hitnormal")]
[TestCase("hitnormal")]
public void TestDefaultCustomSampleFromBeatmap(string expectedSample)
{
SetupSkins(expectedSample, expectedSample);
@ -80,12 +82,13 @@ namespace osu.Game.Tests.Gameplay
}
/// <summary>
/// Tests that a hitobject which provides a custom sample set of 2 retrieves the following samples from the user skin when the beatmap does not contain the sample:
/// normal-hitnormal2
/// Tests that a hitobject which provides a custom sample set of 2 retrieves the following samples from the user skin
/// (ignoring the custom sample set index) when the beatmap skin does not contain the sample:
/// normal-hitnormal
/// hitnormal
/// </summary>
[TestCase("normal-hitnormal2")]
[TestCase("normal-hitnormal")]
[TestCase("hitnormal")]
public void TestDefaultCustomSampleFromUserSkinFallback(string expectedSample)
{
SetupSkins(string.Empty, expectedSample);
@ -95,6 +98,23 @@ namespace osu.Game.Tests.Gameplay
AssertUserLookup(expectedSample);
}
/// <summary>
/// Tests that a hitobject which provides a custom sample set of 2 does not retrieve a normal-hitnormal2 sample from the user skin
/// if the beatmap skin does not contain the sample.
/// User skins in stable ignore the custom sample set index when performing lookups.
/// </summary>
[Test]
public void TestUserSkinLookupIgnoresSampleBank()
{
const string unwanted_sample = "normal-hitnormal2";
SetupSkins(string.Empty, unwanted_sample);
CreateTestWithBeatmap("hitobject-beatmap-custom-sample.osu");
AssertNoLookup(unwanted_sample);
}
/// <summary>
/// Tests that a hitobject which provides a sample file retrieves the sample file from the beatmap skin.
/// </summary>
@ -145,6 +165,7 @@ namespace osu.Game.Tests.Gameplay
/// </summary>
[TestCase("normal-hitnormal2")]
[TestCase("normal-hitnormal")]
[TestCase("hitnormal")]
public void TestControlPointCustomSampleFromBeatmap(string sampleName)
{
SetupSkins(sampleName, sampleName);
@ -178,7 +199,7 @@ namespace osu.Game.Tests.Gameplay
string[] expectedSamples =
{
"normal-hitnormal2",
"normal-hitwhistle2"
"normal-hitwhistle" // user skin lookups ignore custom sample set index
};
SetupSkins(expectedSamples[0], expectedSamples[1]);

View File

@ -4,19 +4,22 @@
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Framework.Allocation;
using osu.Game.Graphics;
using osu.Game.Overlays;
namespace osu.Game.Tests.Visual.Online
{
public class TestSceneShowMoreButton : OsuTestScene
{
[Cached]
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Green);
public TestSceneShowMoreButton()
{
TestButton button = null;
ShowMoreButton button = null;
int fireCount = 0;
Add(button = new TestButton
Add(button = new ShowMoreButton
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
@ -46,16 +49,5 @@ namespace osu.Game.Tests.Visual.Online
AddAssert("action fired twice", () => fireCount == 2);
AddAssert("is in loading state", () => button.IsLoading);
}
private class TestButton : ShowMoreButton
{
[BackgroundDependencyLoader]
private void load(OsuColour colors)
{
IdleColour = colors.YellowDark;
HoverColour = colors.Yellow;
ChevronIconColour = colors.Red;
}
}
}
}