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:
parent
6e3125e115
commit
5fdc9819cf
@ -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,
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user