mirror of
https://github.com/ppy/osu
synced 2024-12-24 15:53:37 +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);
|
showResult(HitResult.Great);
|
||||||
|
|
||||||
AddUntilStep("judgements shown", () => this.ChildrenOfType<TestDrawableOsuJudgement>().Any());
|
AddUntilStep("judgements shown", () => this.ChildrenOfType<TestDrawableOsuJudgement>().Any());
|
||||||
AddAssert("hit lighting hidden",
|
AddAssert("hit lighting has no transforms", () => this.ChildrenOfType<TestDrawableOsuJudgement>().All(judgement => !judgement.Lighting.Transforms.Any()));
|
||||||
() => this.ChildrenOfType<TestDrawableOsuJudgement>().All(judgement => !judgement.Lighting.Transforms.Any()));
|
AddAssert("hit lighting hidden", () => this.ChildrenOfType<TestDrawableOsuJudgement>().All(judgement => judgement.Lighting.Alpha == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -55,8 +55,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
showResult(HitResult.Great);
|
showResult(HitResult.Great);
|
||||||
|
|
||||||
AddUntilStep("judgements shown", () => this.ChildrenOfType<TestDrawableOsuJudgement>().Any());
|
AddUntilStep("judgements shown", () => this.ChildrenOfType<TestDrawableOsuJudgement>().Any());
|
||||||
AddAssert("hit lighting shown",
|
AddUntilStep("hit lighting shown", () => this.ChildrenOfType<TestDrawableOsuJudgement>().Any(judgement => judgement.Lighting.Alpha > 0));
|
||||||
() => this.ChildrenOfType<TestDrawableOsuJudgement>().Any(judgement => judgement.Lighting.Transforms.Any()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showResult(HitResult result)
|
private void showResult(HitResult result)
|
||||||
|
@ -48,6 +48,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
bool hitLightingEnabled = config.Get<bool>(OsuSetting.HitLighting);
|
bool hitLightingEnabled = config.Get<bool>(OsuSetting.HitLighting);
|
||||||
|
|
||||||
|
Lighting.Alpha = 0;
|
||||||
|
|
||||||
if (hitLightingEnabled && Lighting.Drawable != null)
|
if (hitLightingEnabled && Lighting.Drawable != null)
|
||||||
{
|
{
|
||||||
// todo: this animation changes slightly based on new/old legacy skin versions.
|
// todo: this animation changes slightly based on new/old legacy skin versions.
|
||||||
|
Loading…
Reference in New Issue
Block a user