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