diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index 3cf2e0f413..7696e82009 100644 --- a/osu.Game/Graphics/Containers/ParallaxContainer.cs +++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs @@ -17,22 +17,6 @@ namespace osu.Game.Graphics.Containers public float ParallaxAmount = 0.02f; 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; @@ -59,7 +43,12 @@ namespace osu.Game.Graphics.Containers config.GetBindable(OsuConfig.MenuParallax).ValueChanged += delegate { - ParallaxEnabled = config.GetBindable(OsuConfig.MenuParallax); + parallaxEnabled = config.GetBindable(OsuConfig.MenuParallax); + if (!parallaxEnabled) + { + content.MoveTo(Vector2.Zero, firstUpdate ? 0 : 1000, EasingTypes.OutQuint); + content.Scale = Vector2.One; + } }; } @@ -69,7 +58,7 @@ namespace osu.Game.Graphics.Containers { base.Update(); - if (ParallaxEnabled) { + if (parallaxEnabled) { Vector2 offset = input.CurrentState.Mouse == null ? Vector2.Zero : ToLocalSpace(input.CurrentState.Mouse.NativeState.Position) - DrawSize / 2; content.MoveTo(offset * ParallaxAmount, firstUpdate ? 0 : 1000, EasingTypes.OutQuint); content.Scale = new Vector2(1 + ParallaxAmount);