mirror of https://github.com/ppy/osu
Flip condition to reduce nesting
This commit is contained in:
parent
157e1d8965
commit
29b29cde8e
|
@ -101,28 +101,28 @@ private void onIsHittingChanged(ValueChangedEvent<bool> isHitting)
|
||||||
bodyAnimation.IsPlaying = isHitting.NewValue;
|
bodyAnimation.IsPlaying = isHitting.NewValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lightContainer != null)
|
if (lightContainer == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (isHitting.NewValue)
|
||||||
{
|
{
|
||||||
if (isHitting.NewValue)
|
// Clear the fade out and, more importantly, the removal.
|
||||||
{
|
lightContainer.ClearTransforms();
|
||||||
// Clear the fade out and, more importantly, the removal.
|
|
||||||
lightContainer.ClearTransforms();
|
|
||||||
|
|
||||||
// Only add the container if the removal has taken place.
|
// Only add the container if the removal has taken place.
|
||||||
if (lightContainer.Parent == null)
|
if (lightContainer.Parent == null)
|
||||||
Column.TopLevelContainer.Add(lightContainer);
|
Column.TopLevelContainer.Add(lightContainer);
|
||||||
|
|
||||||
// The light must be seeked only after being loaded, otherwise a nullref occurs (https://github.com/ppy/osu-framework/issues/3847).
|
// The light must be seeked only after being loaded, otherwise a nullref occurs (https://github.com/ppy/osu-framework/issues/3847).
|
||||||
if (light is TextureAnimation lightAnimation)
|
if (light is TextureAnimation lightAnimation)
|
||||||
lightAnimation.GotoFrame(0);
|
lightAnimation.GotoFrame(0);
|
||||||
|
|
||||||
lightContainer.FadeIn(80);
|
lightContainer.FadeIn(80);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lightContainer.FadeOut(120)
|
lightContainer.FadeOut(120)
|
||||||
.OnComplete(d => Column.TopLevelContainer.Remove(d));
|
.OnComplete(d => Column.TopLevelContainer.Remove(d));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue