mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 11:12:54 +08:00
Move player-specific configuration bindables back to player
This commit is contained in:
parent
2cb197d0c4
commit
6d91889ca6
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
@ -16,6 +17,7 @@ using osu.Framework.Screens;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Online.API;
|
||||
@ -43,6 +45,9 @@ namespace osu.Game.Screens.Play
|
||||
public bool AllowLeadIn { get; set; } = true;
|
||||
public bool AllowResults { get; set; } = true;
|
||||
|
||||
private Bindable<bool> mouseWheelDisabled;
|
||||
private Bindable<double> userAudioOffset;
|
||||
|
||||
public int RestartCount;
|
||||
|
||||
public CursorContainer Cursor => RulesetContainer.Cursor;
|
||||
@ -75,11 +80,14 @@ namespace osu.Game.Screens.Play
|
||||
private bool loadedSuccessfully => RulesetContainer?.Objects.Any() == true;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio, APIAccess api)
|
||||
private void load(AudioManager audio, APIAccess api, OsuConfigManager config)
|
||||
{
|
||||
this.api = api;
|
||||
sampleRestart = audio.Sample.Get(@"Gameplay/restart");
|
||||
|
||||
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
|
||||
userAudioOffset = config.GetBindable<double>(OsuSetting.AudioOffset);
|
||||
|
||||
WorkingBeatmap working = Beatmap.Value;
|
||||
Beatmap beatmap;
|
||||
|
||||
@ -131,8 +139,8 @@ namespace osu.Game.Screens.Play
|
||||
// the final usable gameplay clock with user-set offsets applied.
|
||||
var offsetClock = new FramedOffsetClock(adjustableClock);
|
||||
|
||||
UserAudioOffset.ValueChanged += v => offsetClock.Offset = v;
|
||||
UserAudioOffset.TriggerChange();
|
||||
userAudioOffset.ValueChanged += v => offsetClock.Offset = v;
|
||||
userAudioOffset.TriggerChange();
|
||||
|
||||
scoreProcessor = RulesetContainer.CreateScoreProcessor();
|
||||
|
||||
@ -342,7 +350,7 @@ namespace osu.Game.Screens.Play
|
||||
Background?.FadeTo(1f, fade_out_duration);
|
||||
}
|
||||
|
||||
protected override bool OnWheel(InputState state) => MouseWheelDisabled.Value && !pauseContainer.IsPaused;
|
||||
protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !pauseContainer.IsPaused;
|
||||
|
||||
private void initializeStoryboard(bool asyncLoad)
|
||||
{
|
||||
|
@ -26,8 +26,6 @@ namespace osu.Game.Screens.Play
|
||||
protected Bindable<double> DimLevel;
|
||||
protected Bindable<double> BlurLevel;
|
||||
protected Bindable<bool> ShowStoryboard;
|
||||
protected Bindable<bool> MouseWheelDisabled;
|
||||
protected Bindable<double> UserAudioOffset;
|
||||
|
||||
#endregion
|
||||
|
||||
@ -37,10 +35,6 @@ namespace osu.Game.Screens.Play
|
||||
DimLevel = config.GetBindable<double>(OsuSetting.DimLevel);
|
||||
BlurLevel = config.GetBindable<double>(OsuSetting.BlurLevel);
|
||||
ShowStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
||||
|
||||
MouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
|
||||
|
||||
UserAudioOffset = config.GetBindable<double>(OsuSetting.AudioOffset);
|
||||
}
|
||||
|
||||
protected override void OnEntering(Screen last)
|
||||
|
Loading…
Reference in New Issue
Block a user