mirror of
https://github.com/ppy/osu
synced 2024-12-23 23:33:36 +00:00
Add better test coverage of hit lighting (and ensure reset after animation reapplication)
This commit is contained in:
parent
ba735584fa
commit
3024ae6d86
@ -43,8 +43,8 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
showResult(HitResult.Great);
|
||||
|
||||
AddUntilStep("judgements shown", () => this.ChildrenOfType<TestDrawableOsuJudgement>().Any());
|
||||
AddAssert("hit lighting hidden",
|
||||
() => this.ChildrenOfType<TestDrawableOsuJudgement>().All(judgement => !judgement.Lighting.Transforms.Any()));
|
||||
AddAssert("hit lighting has no transforms", () => this.ChildrenOfType<TestDrawableOsuJudgement>().All(judgement => !judgement.Lighting.Transforms.Any()));
|
||||
AddAssert("hit lighting hidden", () => this.ChildrenOfType<TestDrawableOsuJudgement>().All(judgement => judgement.Lighting.Alpha == 0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -55,8 +55,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
showResult(HitResult.Great);
|
||||
|
||||
AddUntilStep("judgements shown", () => this.ChildrenOfType<TestDrawableOsuJudgement>().Any());
|
||||
AddAssert("hit lighting shown",
|
||||
() => this.ChildrenOfType<TestDrawableOsuJudgement>().Any(judgement => judgement.Lighting.Transforms.Any()));
|
||||
AddUntilStep("hit lighting shown", () => this.ChildrenOfType<TestDrawableOsuJudgement>().Any(judgement => judgement.Lighting.Alpha > 0));
|
||||
}
|
||||
|
||||
private void showResult(HitResult result)
|
||||
|
@ -48,6 +48,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
{
|
||||
bool hitLightingEnabled = config.Get<bool>(OsuSetting.HitLighting);
|
||||
|
||||
Lighting.Alpha = 0;
|
||||
|
||||
if (hitLightingEnabled && Lighting.Drawable != null)
|
||||
{
|
||||
// todo: this animation changes slightly based on new/old legacy skin versions.
|
||||
|
Loading…
Reference in New Issue
Block a user