1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:20:04 +08:00

add hit lighting test in test scene catcher area

This commit is contained in:
Gagah Pangeran 2020-07-16 15:25:07 +07:00
parent 16d429d2b6
commit 7021459c75

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Configuration;
using osu.Game.Rulesets.Catch.Beatmaps;
using osu.Game.Rulesets.Catch.Judgements;
using osu.Game.Rulesets.Catch.Objects;
@ -24,6 +25,7 @@ namespace osu.Game.Rulesets.Catch.Tests
public class TestSceneCatcherArea : CatchSkinnableTestScene
{
private RulesetInfo catchRuleset;
private OsuConfigManager config;
public TestSceneCatcherArea()
{
@ -52,6 +54,24 @@ namespace osu.Game.Rulesets.Catch.Tests
}, true), 20);
}
[TestCase(true)]
[TestCase(false)]
public void TestHitLighting(bool enable) {
Catcher catcher = this.ChildrenOfType<CatcherArea>().First().MovableCatcher;
AddStep("Toggle hit lighting", () => config.Set(OsuSetting.HitLighting, enable));
AddStep("Catch fruit", () => catchFruit(new TestFruit(false)
{
X = catcher.X
}));
AddStep("Catch fruit last combo", () => catchFruit(new TestFruit(false)
{
X = catcher.X,
LastInCombo = true
}));
AddAssert("Check hit explotion", () => catcher.ChildrenOfType<HitExplosion>().Any() == enable);
}
private void catchFruit(Fruit fruit, bool miss = false)
{
this.ChildrenOfType<CatcherArea>().ForEach(area =>
@ -84,9 +104,10 @@ namespace osu.Game.Rulesets.Catch.Tests
}
[BackgroundDependencyLoader]
private void load(RulesetStore rulesets)
private void load(RulesetStore rulesets, OsuConfigManager configManager)
{
catchRuleset = rulesets.GetRuleset(2);
config = configManager;
}
public class TestFruit : Fruit