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

Add OSD + config value for scroll speed

This commit is contained in:
smoogipoo 2018-01-11 13:40:46 +09:00
parent 3a869edf36
commit a6d8b28221
4 changed files with 17 additions and 5 deletions

View File

@ -15,6 +15,7 @@ using osu.Framework.Configuration;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Configuration;
using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.UI.Scrolling; using osu.Game.Rulesets.UI.Scrolling;
@ -161,8 +162,10 @@ namespace osu.Game.Rulesets.Mania.UI
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours, OsuConfigManager config)
{ {
config.BindWith(OsuSetting.UserScrollSpeed, VisibleTimeRange);
normalColumnColours = new List<Color4> normalColumnColours = new List<Color4>
{ {
colours.RedDark, colours.RedDark,

View File

@ -73,6 +73,7 @@ namespace osu.Game.Configuration
Set(OsuSetting.FloatingComments, false); Set(OsuSetting.FloatingComments, false);
Set(OsuSetting.ScrollingAlgorithm, ScrollingAlgorithmType.Global); Set(OsuSetting.ScrollingAlgorithm, ScrollingAlgorithmType.Global);
Set(OsuSetting.UserScrollSpeed, 1500.0, 50.0, 10000.0);
// Update // Update
Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer); Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer);
@ -119,6 +120,7 @@ namespace osu.Game.Configuration
ChatDisplayHeight, ChatDisplayHeight,
Version, Version,
ShowConvertedBeatmaps, ShowConvertedBeatmaps,
ScrollingAlgorithm ScrollingAlgorithm,
UserScrollSpeed
} }
} }

View File

@ -14,6 +14,7 @@ using osu.Game.Graphics;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Game.Configuration;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays namespace osu.Game.Overlays
@ -115,7 +116,7 @@ namespace osu.Game.Overlays
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(FrameworkConfigManager frameworkConfig) private void load(FrameworkConfigManager frameworkConfig, OsuConfigManager osuConfig)
{ {
trackSetting(frameworkConfig.GetBindable<FrameSync>(FrameworkSetting.FrameSync), v => display(v, "Frame Limiter", v.GetDescription(), "Ctrl+F7")); trackSetting(frameworkConfig.GetBindable<FrameSync>(FrameworkSetting.FrameSync), v => display(v, "Frame Limiter", v.GetDescription(), "Ctrl+F7"));
trackSetting(frameworkConfig.GetBindable<string>(FrameworkSetting.AudioDevice), v => display(v, "Audio Device", string.IsNullOrEmpty(v) ? "Default" : v, v)); trackSetting(frameworkConfig.GetBindable<string>(FrameworkSetting.AudioDevice), v => display(v, "Audio Device", string.IsNullOrEmpty(v) ? "Default" : v, v));
@ -135,6 +136,9 @@ namespace osu.Game.Overlays
}); });
trackSetting(frameworkConfig.GetBindable<WindowMode>(FrameworkSetting.WindowMode), v => display(v, "Screen Mode", v.ToString(), "Alt+Enter")); trackSetting(frameworkConfig.GetBindable<WindowMode>(FrameworkSetting.WindowMode), v => display(v, "Screen Mode", v.ToString(), "Alt+Enter"));
// Todo: This should be part of the ruleset-specific OSD
trackSetting(osuConfig.GetBindable<double>(OsuSetting.UserScrollSpeed), v => display(v, "Scroll Speed", $"{v:N0}ms", "Ctrl+(+/-) to change"));
} }
private readonly List<IBindable> references = new List<IBindable>(); private readonly List<IBindable> references = new List<IBindable>();

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -102,13 +103,15 @@ namespace osu.Game.Rulesets.UI.Scrolling
if (state.Keyboard.ControlPressed) if (state.Keyboard.ControlPressed)
{ {
var lastValue = Transforms.OfType<TransformVisibleTimeRange>().LastOrDefault()?.EndValue ?? VisibleTimeRange.Value;
switch (args.Key) switch (args.Key)
{ {
case Key.Minus: case Key.Minus:
transformVisibleTimeRangeTo(VisibleTimeRange + time_span_step, 200, Easing.OutQuint); transformVisibleTimeRangeTo(lastValue + time_span_step, 200, Easing.OutQuint);
break; break;
case Key.Plus: case Key.Plus:
transformVisibleTimeRangeTo(VisibleTimeRange - time_span_step, 200, Easing.OutQuint); transformVisibleTimeRangeTo(lastValue - time_span_step, 200, Easing.OutQuint);
break; break;
} }
} }