1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 10:43:04 +08:00

Add basic UO support (now called Audio Offset).

This commit is contained in:
Dean Herbert 2017-04-21 16:19:40 +09:00
parent 6e3125e115
commit 5fdc9819cf
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
3 changed files with 22 additions and 8 deletions

View File

@ -38,6 +38,8 @@ namespace osu.Game.Configuration
Set(OsuConfig.KeyOverlay, false); Set(OsuConfig.KeyOverlay, false);
//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.AudioOffset, 0, -500.0, 500.0);
Set(OsuConfig.MouseSpeed, 1.0).Disabled = true; Set(OsuConfig.MouseSpeed, 1.0).Disabled = true;
Set(OsuConfig.BeatmapDirectory, @"Songs").Disabled = true; // TODO: use thi.Disabled = trues Set(OsuConfig.BeatmapDirectory, @"Songs").Disabled = true; // TODO: use thi.Disabled = trues
Set(OsuConfig.AllowPublicInvites, true).Disabled = true; Set(OsuConfig.AllowPublicInvites, true).Disabled = true;
@ -103,7 +105,6 @@ namespace osu.Game.Configuration
Set(OsuConfig.ManiaSpeedBPMScale, true).Disabled = true; Set(OsuConfig.ManiaSpeedBPMScale, true).Disabled = true;
Set(OsuConfig.MenuTip, 0).Disabled = true; Set(OsuConfig.MenuTip, 0).Disabled = true;
Set(OsuConfig.MouseSpeed, 1, 0.4, 6).Disabled = true; Set(OsuConfig.MouseSpeed, 1, 0.4, 6).Disabled = true;
Set(OsuConfig.Offset, 0, -300, 300).Disabled = true;
Set(OsuConfig.ScoreMeterScale, 1, 0.5, 2).Disabled = true; Set(OsuConfig.ScoreMeterScale, 1, 0.5, 2).Disabled = true;
//Set(OsuConfig.ScoreMeterScale, 1, 0.5, OsuGame.Tournament ? 10 : 2).Disabled = true; //Set(OsuConfig.ScoreMeterScale, 1, 0.5, OsuGame.Tournament ? 10 : 2).Disabled = true;
Set(OsuConfig.DistanceSpacing, 0.8, 0.1, 6).Disabled = true; Set(OsuConfig.DistanceSpacing, 0.8, 0.1, 6).Disabled = true;
@ -270,7 +271,7 @@ namespace osu.Game.Configuration
MouseDisableButtons, MouseDisableButtons,
MouseDisableWheel, MouseDisableWheel,
MouseSpeed, MouseSpeed,
Offset, AudioOffset,
ScoreMeterScale, ScoreMeterScale,
DistanceSpacing, DistanceSpacing,
EditorBeatDivisor, EditorBeatDivisor,

View File

@ -18,10 +18,10 @@ namespace osu.Game.Overlays.Options.Sections.Audio
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new OptionSlider<int> new OptionSlider<double>
{ {
LabelText = "Universal Offset", LabelText = "Audio Offset",
Bindable = (BindableInt)config.GetBindable<int>(OsuConfig.Offset) Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.AudioOffset)
}, },
new OsuButton new OsuButton
{ {

View File

@ -49,13 +49,22 @@ namespace osu.Game.Screens.Play
private bool canPause => ValidForResume && !HasFailed && Time.Current >= lastPauseActionTime + pause_cooldown; private bool canPause => ValidForResume && !HasFailed && Time.Current >= lastPauseActionTime + pause_cooldown;
private IAdjustableClock sourceClock; private IAdjustableClock sourceClock;
private OffsetClock offsetClock;
private IFrameBasedClock interpolatedSourceClock; private IFrameBasedClock interpolatedSourceClock;
private RulesetInfo ruleset; private RulesetInfo ruleset;
private ScoreProcessor scoreProcessor; private ScoreProcessor scoreProcessor;
protected HitRenderer HitRenderer; protected HitRenderer HitRenderer;
#region User Settings
private Bindable<int> dimLevel; private Bindable<int> dimLevel;
private Bindable<bool> mouseWheelDisabled;
private Bindable<double> userAudioOffset;
#endregion
private SkipButton skipButton; private SkipButton skipButton;
private HudOverlay hudOverlay; private HudOverlay hudOverlay;
@ -115,7 +124,13 @@ namespace osu.Game.Screens.Play
} }
sourceClock = (IAdjustableClock)track ?? new StopwatchClock(); sourceClock = (IAdjustableClock)track ?? new StopwatchClock();
interpolatedSourceClock = new InterpolatingFramedClock(sourceClock); offsetClock = new OffsetClock(sourceClock);
userAudioOffset = config.GetBindable<double>(OsuConfig.AudioOffset);
userAudioOffset.ValueChanged += v => offsetClock.Offset = v;
userAudioOffset.TriggerChange();
interpolatedSourceClock = new InterpolatingFramedClock(offsetClock);
Schedule(() => Schedule(() =>
{ {
@ -360,8 +375,6 @@ namespace osu.Game.Screens.Play
Background?.FadeTo(1f, fade_out_duration); Background?.FadeTo(1f, fade_out_duration);
} }
private Bindable<bool> mouseWheelDisabled;
protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !IsPaused; protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !IsPaused;
} }
} }