diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index 328d74994e..3cf2e0f413 100644 --- a/osu.Game/Graphics/Containers/ParallaxContainer.cs +++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs @@ -15,7 +15,24 @@ namespace osu.Game.Graphics.Containers class ParallaxContainer : Container { public float ParallaxAmount = 0.02f; - public bool ParallaxEnabled = true; + + private bool parallaxEnabled = true; + public bool ParallaxEnabled + { + get + { + return parallaxEnabled; + } + set + { + parallaxEnabled = value; + if (!parallaxEnabled) + { + content.MoveTo(Vector2.Zero, 1000, EasingTypes.OutQuint); + content.Scale = Vector2.One; + } + } + } public override bool Contains(Vector2 screenSpacePos) => true; @@ -43,11 +60,6 @@ namespace osu.Game.Graphics.Containers config.GetBindable(OsuConfig.MenuParallax).ValueChanged += delegate { ParallaxEnabled = config.GetBindable(OsuConfig.MenuParallax); - if (!ParallaxEnabled) - { - content.MoveTo(Vector2.Zero, 1000, EasingTypes.OutQuint); - content.Scale = Vector2.One; - } }; }