-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix combo colour normalisation setting not applying to editor test play
- Loading branch information
Showing
1 changed file
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using osu.Framework.Allocation; | ||
using osu.Framework.Bindables; | ||
using osu.Framework.Screens; | ||
using osu.Game.Beatmaps; | ||
using osu.Game.Configuration; | ||
using osu.Game.Overlays; | ||
using osu.Game.Screens.Play; | ||
|
||
namespace osu.Game.Screens.Edit.GameplayTest | ||
{ | ||
public class EditorPlayer : Player | ||
public class EditorPlayer : Player, IGameplaySettings | ||
{ | ||
private readonly Editor editor; | ||
private readonly EditorState editorState; | ||
|
||
[Resolved] | ||
private MusicController musicController { get; set; } | ||
private MusicController musicController { get; set; } = null!; | ||
|
||
private OsuConfigManager config = null!; | ||
|
||
public EditorPlayer(Editor editor) | ||
: base(new PlayerConfiguration { ShowResults = false }) | ||
|
@@ -26,6 +28,14 @@ public EditorPlayer(Editor editor) | |
editorState = editor.GetState(); | ||
} | ||
|
||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) | ||
{ | ||
// needs to be populated before BDL to work correctly. | ||
config = parent.Get<OsuConfigManager>(); | ||
|
||
return base.CreateChildDependencies(parent); | ||
} | ||
|
||
protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart) | ||
{ | ||
var masterGameplayClockContainer = new MasterGameplayClockContainer(beatmap, gameplayStart); | ||
|
@@ -74,5 +84,9 @@ public override bool OnExiting(ScreenExitEvent e) | |
editor.RestoreState(editorState); | ||
return base.OnExiting(e); | ||
} | ||
|
||
// Editor overrides but we actually want to use game-wide settings here. | ||
public IBindable<float> ComboColourNormalisationAmount => ((IGameplaySettings)config).ComboColourNormalisationAmount; | ||
public IBindable<float> PositionalHitsoundsLevel => ((IGameplaySettings)config).PositionalHitsoundsLevel; | ||
} | ||
} |