Skip to content

Commit

Permalink
Merge pull request #21257 from peppy/fix-test-mode
Browse files Browse the repository at this point in the history
Fix combo colour normalisation setting not applying to editor test play
  • Loading branch information
smoogipoo authored Nov 17, 2022
2 parents 335e4e8 + 7a28a7f commit b23b5eb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion osu.Game/Configuration/IGameplaySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace osu.Game.Configuration
{
/// <summary>
/// A settings provider which generally sources from <see cref="OsuConfigManager"/> (global user settings)
/// but can allow overriding settings by caching more locally. For instance, in the editor.
/// but can allow overriding settings by caching more locally. For instance, in the editor compose screen.
/// </summary>
/// <remarks>
/// More settings can be moved into this interface as required.
Expand Down
13 changes: 12 additions & 1 deletion osu.Game/Screens/Edit/Compose/ComposeScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Platform;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Extensions;
using osu.Game.IO.Serialization;
using osu.Game.Rulesets;
Expand All @@ -19,14 +20,17 @@

namespace osu.Game.Screens.Edit.Compose
{
public class ComposeScreen : EditorScreenWithTimeline
public class ComposeScreen : EditorScreenWithTimeline, IGameplaySettings
{
[Resolved]
private GameHost host { get; set; }

[Resolved]
private EditorClock clock { get; set; }

[Resolved]
private IGameplaySettings globalGameplaySettings { get; set; }

private Bindable<string> clipboard { get; set; }

private HitObjectComposer composer;
Expand Down Expand Up @@ -157,5 +161,12 @@ private string formatSelectionAsString()
}

#endregion

// Combo colour normalisation should not be applied in the editor.
// Note this doesn't affect editor test mode.
IBindable<float> IGameplaySettings.ComboColourNormalisationAmount => new Bindable<float>();

// Arguable.
IBindable<float> IGameplaySettings.PositionalHitsoundsLevel => globalGameplaySettings.PositionalHitsoundsLevel;
}
}
12 changes: 1 addition & 11 deletions osu.Game/Screens/Edit/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ namespace osu.Game.Screens.Edit
{
[Cached(typeof(IBeatSnapProvider))]
[Cached]
public class Editor : ScreenWithBeatmapBackground, IKeyBindingHandler<GlobalAction>, IKeyBindingHandler<PlatformAction>, IBeatSnapProvider, ISamplePlaybackDisabler, IBeatSyncProvider,
IGameplaySettings
public class Editor : ScreenWithBeatmapBackground, IKeyBindingHandler<GlobalAction>, IKeyBindingHandler<PlatformAction>, IBeatSnapProvider, ISamplePlaybackDisabler, IBeatSyncProvider
{
public override float BackgroundParallaxAmount => 0.1f;

Expand Down Expand Up @@ -99,9 +98,6 @@ protected bool HasUnsavedChanges
[Resolved(canBeNull: true)]
private INotificationOverlay notifications { get; set; }

[Resolved]
private IGameplaySettings globalGameplaySettings { get; set; }

public readonly Bindable<EditorScreenMode> Mode = new Bindable<EditorScreenMode>();

public IBindable<bool> SamplePlaybackDisabled => samplePlaybackDisabled;
Expand Down Expand Up @@ -1045,11 +1041,5 @@ public BeatmapEditorToast(LocalisableString value, string beatmapDisplayName)
{
}
}

// Combo colour normalisation should not be applied in the editor.
IBindable<float> IGameplaySettings.ComboColourNormalisationAmount => new Bindable<float>();

// Arguable.
IBindable<float> IGameplaySettings.PositionalHitsoundsLevel => globalGameplaySettings.PositionalHitsoundsLevel;
}
}
4 changes: 1 addition & 3 deletions osu.Game/Screens/Edit/GameplayTest/EditorPlayer.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// 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.Screens;
using osu.Game.Beatmaps;
Expand All @@ -17,7 +15,7 @@ public class EditorPlayer : Player
private readonly EditorState editorState;

[Resolved]
private MusicController musicController { get; set; }
private MusicController musicController { get; set; } = null!;

public EditorPlayer(Editor editor)
: base(new PlayerConfiguration { ShowResults = false })
Expand Down

0 comments on commit b23b5eb

Please sign in to comment.