1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 07:22:55 +08:00

add setting to toggle the gameplay cursor trail

This commit is contained in:
Unknown 2019-01-23 14:27:34 +01:00
parent 4d310c3226
commit 481f33d17b
4 changed files with 19 additions and 7 deletions

View File

@ -19,12 +19,14 @@ namespace osu.Game.Rulesets.Osu.Configuration
Set(OsuSetting.SnakingInSliders, true); Set(OsuSetting.SnakingInSliders, true);
Set(OsuSetting.SnakingOutSliders, true); Set(OsuSetting.SnakingOutSliders, true);
Set(OsuSetting.ShowCursorTrail, true);
} }
} }
public enum OsuSetting public enum OsuSetting
{ {
SnakingInSliders, SnakingInSliders,
SnakingOutSliders SnakingOutSliders,
ShowCursorTrail
} }
} }

View File

@ -11,6 +11,7 @@ using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Bindings; using osu.Framework.Input.Bindings;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Rulesets.Osu.Configuration;
using osu.Game.Skinning; using osu.Game.Skinning;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
@ -23,6 +24,8 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
protected override Container<Drawable> Content => fadeContainer; protected override Container<Drawable> Content => fadeContainer;
private Bindable<bool> showTrail;
private readonly CursorTrail cursorTrail;
private readonly Container<Drawable> fadeContainer; private readonly Container<Drawable> fadeContainer;
public GameplayCursor() public GameplayCursor()
@ -32,11 +35,18 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
{ {
new CursorTrail { Depth = 1 } cursorTrail = new CursorTrail { Depth = 1 }
} }
}; };
} }
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
showTrail = config.GetBindable<bool>(OsuSetting.ShowCursorTrail);
showTrail.ValueChanged += v => cursorTrail.Alpha = v ? 1 : 0;
}
private int downCount; private int downCount;
private void updateExpandedState() private void updateExpandedState()

View File

@ -34,6 +34,11 @@ namespace osu.Game.Rulesets.Osu.UI
LabelText = "Snaking out sliders", LabelText = "Snaking out sliders",
Bindable = config.GetBindable<bool>(OsuSetting.SnakingOutSliders) Bindable = config.GetBindable<bool>(OsuSetting.SnakingOutSliders)
}, },
new SettingsCheckbox
{
LabelText = "Show cursor trail",
Bindable = config.GetBindable<bool>(OsuSetting.ShowCursorTrail)
},
}; };
} }
} }

View File

@ -72,9 +72,6 @@ namespace osu.Game.Configuration
Set(GameSetting.MenuParallax, true); Set(GameSetting.MenuParallax, true);
Set(GameSetting.SnakingInSliders, true);
Set(GameSetting.SnakingOutSliders, true);
// Gameplay // Gameplay
Set(GameSetting.DimLevel, 0.3, 0, 1, 0.01); Set(GameSetting.DimLevel, 0.3, 0, 1, 0.01);
Set(GameSetting.BlurLevel, 0, 0, 1, 0.01); Set(GameSetting.BlurLevel, 0, 0, 1, 0.01);
@ -150,8 +147,6 @@ namespace osu.Game.Configuration
DisplayStarsMinimum, DisplayStarsMinimum,
DisplayStarsMaximum, DisplayStarsMaximum,
RandomSelectAlgorithm, RandomSelectAlgorithm,
SnakingInSliders,
SnakingOutSliders,
ShowFpsDisplay, ShowFpsDisplay,
ChatDisplayHeight, ChatDisplayHeight,
Version, Version,