mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Moved movement to the default position to property
This commit is contained in:
@ -15,7 +15,24 @@ namespace osu.Game.Graphics.Containers
|
|||||||
class ParallaxContainer : Container
|
class ParallaxContainer : Container
|
||||||
{
|
{
|
||||||
public float ParallaxAmount = 0.02f;
|
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;
|
public override bool Contains(Vector2 screenSpacePos) => true;
|
||||||
|
|
||||||
@ -43,11 +60,6 @@ namespace osu.Game.Graphics.Containers
|
|||||||
config.GetBindable<bool>(OsuConfig.MenuParallax).ValueChanged += delegate
|
config.GetBindable<bool>(OsuConfig.MenuParallax).ValueChanged += delegate
|
||||||
{
|
{
|
||||||
ParallaxEnabled = config.GetBindable<bool>(OsuConfig.MenuParallax);
|
ParallaxEnabled = config.GetBindable<bool>(OsuConfig.MenuParallax);
|
||||||
if (!ParallaxEnabled)
|
|
||||||
{
|
|
||||||
content.MoveTo(Vector2.Zero, 1000, EasingTypes.OutQuint);
|
|
||||||
content.Scale = Vector2.One;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user