mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 06:12:58 +08:00
Merge branch 'master' into difficulty-calculator
This commit is contained in:
commit
444c3ba817
@ -31,6 +31,7 @@ namespace osu.Game.Configuration
|
|||||||
Set(OsuConfig.SnakingInSliders, true);
|
Set(OsuConfig.SnakingInSliders, true);
|
||||||
Set(OsuConfig.SnakingOutSliders, false);
|
Set(OsuConfig.SnakingOutSliders, false);
|
||||||
|
|
||||||
|
Set(OsuConfig.MenuParallax, true);
|
||||||
//todo: implement all settings below this line (remove the Disabled set when doing so).
|
//todo: implement all settings below this line (remove the Disabled set when doing so).
|
||||||
|
|
||||||
Set(OsuConfig.MouseSpeed, 1.0).Disabled = true;
|
Set(OsuConfig.MouseSpeed, 1.0).Disabled = true;
|
||||||
@ -143,7 +144,6 @@ namespace osu.Game.Configuration
|
|||||||
Set(OsuConfig.DetectPerformanceIssues, true).Disabled = true;
|
Set(OsuConfig.DetectPerformanceIssues, true).Disabled = true;
|
||||||
Set(OsuConfig.MenuMusic, true).Disabled = true;
|
Set(OsuConfig.MenuMusic, true).Disabled = true;
|
||||||
Set(OsuConfig.MenuVoice, true).Disabled = true;
|
Set(OsuConfig.MenuVoice, true).Disabled = true;
|
||||||
Set(OsuConfig.MenuParallax, true).Disabled = true;
|
|
||||||
Set(OsuConfig.RawInput, false).Disabled = true;
|
Set(OsuConfig.RawInput, false).Disabled = true;
|
||||||
Set(OsuConfig.AbsoluteToOsuWindow, Get<bool>(OsuConfig.RawInput)).Disabled = true;
|
Set(OsuConfig.AbsoluteToOsuWindow, Get<bool>(OsuConfig.RawInput)).Disabled = true;
|
||||||
Set(OsuConfig.ShowMenuTips, true).Disabled = true;
|
Set(OsuConfig.ShowMenuTips, true).Disabled = true;
|
||||||
|
@ -8,6 +8,8 @@ using OpenTK;
|
|||||||
using osu.Framework;
|
using osu.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics.Transformations;
|
using osu.Framework.Graphics.Transformations;
|
||||||
|
using osu.Game.Configuration;
|
||||||
|
using osu.Framework.Configuration;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Containers
|
namespace osu.Game.Graphics.Containers
|
||||||
{
|
{
|
||||||
@ -15,6 +17,8 @@ namespace osu.Game.Graphics.Containers
|
|||||||
{
|
{
|
||||||
public float ParallaxAmount = 0.02f;
|
public float ParallaxAmount = 0.02f;
|
||||||
|
|
||||||
|
private Bindable<bool> parallaxEnabled;
|
||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => true;
|
public override bool Contains(Vector2 screenSpacePos) => true;
|
||||||
|
|
||||||
public ParallaxContainer()
|
public ParallaxContainer()
|
||||||
@ -34,9 +38,18 @@ namespace osu.Game.Graphics.Containers
|
|||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(UserInputManager input)
|
private void load(UserInputManager input, OsuConfigManager config)
|
||||||
{
|
{
|
||||||
this.input = input;
|
this.input = input;
|
||||||
|
parallaxEnabled = config.GetBindable<bool>(OsuConfig.MenuParallax);
|
||||||
|
parallaxEnabled.ValueChanged += delegate
|
||||||
|
{
|
||||||
|
if (!parallaxEnabled)
|
||||||
|
{
|
||||||
|
content.MoveTo(Vector2.Zero, firstUpdate ? 0 : 1000, EasingTypes.OutQuint);
|
||||||
|
content.Scale = new Vector2(1 + ParallaxAmount);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool firstUpdate = true;
|
bool firstUpdate = true;
|
||||||
@ -45,9 +58,12 @@ namespace osu.Game.Graphics.Containers
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
Vector2 offset = input.CurrentState.Mouse == null ? Vector2.Zero : ToLocalSpace(input.CurrentState.Mouse.NativeState.Position) - DrawSize / 2;
|
if (parallaxEnabled)
|
||||||
content.MoveTo(offset * ParallaxAmount, firstUpdate ? 0 : 1000, EasingTypes.OutQuint);
|
{
|
||||||
content.Scale = new Vector2(1 + ParallaxAmount);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
firstUpdate = false;
|
firstUpdate = false;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,6 @@ namespace osu.Game.Screens.Menu
|
|||||||
background.Preload(game);
|
background.Preload(game);
|
||||||
|
|
||||||
buttons.OnSettings = game.ToggleOptions;
|
buttons.OnSettings = game.ToggleOptions;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnEntering(Screen last)
|
protected override void OnEntering(Screen last)
|
||||||
|
Loading…
Reference in New Issue
Block a user