From 481f33d17be543c6cef45f5d9e4875cde2e94432 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 23 Jan 2019 14:27:34 +0100 Subject: [PATCH] add setting to toggle the gameplay cursor trail --- .../Configuration/OsuConfigManager.cs | 4 +++- osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs | 12 +++++++++++- osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs | 5 +++++ osu.Game/Configuration/GameConfigManager.cs | 5 ----- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs b/osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs index 4fa49faf1d..492cc7cc7f 100644 --- a/osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs +++ b/osu.Game.Rulesets.Osu/Configuration/OsuConfigManager.cs @@ -19,12 +19,14 @@ namespace osu.Game.Rulesets.Osu.Configuration Set(OsuSetting.SnakingInSliders, true); Set(OsuSetting.SnakingOutSliders, true); + Set(OsuSetting.ShowCursorTrail, true); } } public enum OsuSetting { SnakingInSliders, - SnakingOutSliders + SnakingOutSliders, + ShowCursorTrail } } diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index 582b99af7c..cf6ae2ad3d 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -11,6 +11,7 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Input.Bindings; using osu.Game.Beatmaps; using osu.Game.Configuration; +using osu.Game.Rulesets.Osu.Configuration; using osu.Game.Skinning; using osuTK; using osuTK.Graphics; @@ -23,6 +24,8 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor protected override Container Content => fadeContainer; + private Bindable showTrail; + private readonly CursorTrail cursorTrail; private readonly Container fadeContainer; public GameplayCursor() @@ -32,11 +35,18 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - new CursorTrail { Depth = 1 } + cursorTrail = new CursorTrail { Depth = 1 } } }; } + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + showTrail = config.GetBindable(OsuSetting.ShowCursorTrail); + showTrail.ValueChanged += v => cursorTrail.Alpha = v ? 1 : 0; + } + private int downCount; private void updateExpandedState() diff --git a/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs b/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs index 9aa0f4101d..12ef66fa25 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuSettingsSubsection.cs @@ -34,6 +34,11 @@ namespace osu.Game.Rulesets.Osu.UI LabelText = "Snaking out sliders", Bindable = config.GetBindable(OsuSetting.SnakingOutSliders) }, + new SettingsCheckbox + { + LabelText = "Show cursor trail", + Bindable = config.GetBindable(OsuSetting.ShowCursorTrail) + }, }; } } diff --git a/osu.Game/Configuration/GameConfigManager.cs b/osu.Game/Configuration/GameConfigManager.cs index 736273dc35..b2f2a8e971 100644 --- a/osu.Game/Configuration/GameConfigManager.cs +++ b/osu.Game/Configuration/GameConfigManager.cs @@ -72,9 +72,6 @@ namespace osu.Game.Configuration Set(GameSetting.MenuParallax, true); - Set(GameSetting.SnakingInSliders, true); - Set(GameSetting.SnakingOutSliders, true); - // Gameplay Set(GameSetting.DimLevel, 0.3, 0, 1, 0.01); Set(GameSetting.BlurLevel, 0, 0, 1, 0.01); @@ -150,8 +147,6 @@ namespace osu.Game.Configuration DisplayStarsMinimum, DisplayStarsMaximum, RandomSelectAlgorithm, - SnakingInSliders, - SnakingOutSliders, ShowFpsDisplay, ChatDisplayHeight, Version,