Skip to content

Commit

Permalink
Merge pull request #1993 from andy840119/adjust-permit-null-in-depend…
Browse files Browse the repository at this point in the history
…ency-injection

Adjust permit null in dependency injection
  • Loading branch information
andy840119 authored May 9, 2023
2 parents 8eac5ff + df0c361 commit d619041
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public NoteSection(Note note)
});
}

[BackgroundDependencyLoader(true)]
[BackgroundDependencyLoader]
private void load(HitObjectComposer composer)
{
// todo: not a good way to get change handler, might remove or found another way eventually.
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Karaoke/Edit/EditorNotePlayfield.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public EditorNotePlayfield(int columns)
});
}

[BackgroundDependencyLoader(true)]
[BackgroundDependencyLoader]
private void load()
{
// todo : load data from scoring manager.
Expand Down
8 changes: 3 additions & 5 deletions osu.Game.Rulesets.Karaoke/KaraokeInputManager.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence.
// See the LICENCE file in the repository root for full licence text.

#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -34,10 +32,10 @@ public KaraokeInputManager(RulesetInfo ruleset)
UseParentInput = false;
}

private IBeatmap beatmap;
private IBeatmap beatmap = null!;

[BackgroundDependencyLoader(true)]
private void load(KaraokeRulesetConfigManager config, IBindable<IReadOnlyList<Mod>> mods, IBindable<WorkingBeatmap> beatmap, KaraokeSessionStatics session, EditorBeatmap editorBeatmap)
[BackgroundDependencyLoader]
private void load(KaraokeRulesetConfigManager config, IBindable<IReadOnlyList<Mod>> mods, IBindable<WorkingBeatmap> beatmap, KaraokeSessionStatics session, EditorBeatmap? editorBeatmap)
{
if (editorBeatmap != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#nullable disable

using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
Expand All @@ -23,8 +22,8 @@ protected DrawableKaraokeScrollingHitObject(KaraokeHitObject hitObject)
{
}

[BackgroundDependencyLoader(true)]
private void load([NotNull] IScrollingInfo scrollingInfo)
[BackgroundDependencyLoader]
private void load(IScrollingInfo scrollingInfo)
{
Direction.BindTo(scrollingInfo.Direction);
Direction.BindValueChanged(OnDirectionChanged, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Platform;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Overlays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ public LyricComposer()
}
}

[BackgroundDependencyLoader(true)]
private void load(KaraokeRulesetLyricEditorConfigManager lyricEditorConfigManager, ILyricEditorState state, ITimeTagModeState timeTagModeState)
[BackgroundDependencyLoader]
private void load(KaraokeRulesetLyricEditorConfigManager lyricEditorConfigManager, ILyricEditorState state)
{
lyricEditorConfigManager.BindWith(KaraokeRulesetLyricEditorSetting.ShowPropertyPanelInComposer, panelStatus[PanelType.Property]);
lyricEditorConfigManager.BindWith(KaraokeRulesetLyricEditorSetting.ShowInvalidInfoInComposer, panelStatus[PanelType.InvalidInfo]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected Panel()

protected abstract IReadOnlyList<Drawable> CreateSections();

[BackgroundDependencyLoader(true)]
[BackgroundDependencyLoader]
private void load(ILyricEditorState state, LyricEditorColourProvider colourProvider, AudioManager audio)
{
bindableMode.BindTo(state.BindableMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public SpecialActionToolbar()
};
}

[BackgroundDependencyLoader(true)]
[BackgroundDependencyLoader]
private void load(ILyricEditorState state, LyricEditorColourProvider colourProvider)
{
bindableModeAndSubMode.BindTo(state.BindableModeAndSubMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Separator()
};
}

[BackgroundDependencyLoader(true)]
[BackgroundDependencyLoader]
private void load(ILyricEditorState state, LyricEditorColourProvider colourProvider)
{
bindableMode.BindValueChanged(x =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected override void LoadComplete()
recalculateIssues();
}

[BackgroundDependencyLoader(true)]
[BackgroundDependencyLoader]
private void load(KaraokeRulesetEditCheckerConfigManager? rulesetEditCheckerConfigManager)
{
// todo: adjust the config in the config.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@

#nullable disable

using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Overlays;
using osu.Game.Rulesets.Karaoke.Beatmaps.Metadatas;
using osu.Game.Rulesets.Karaoke.Edit;

namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Singers.Rows;

Expand All @@ -25,8 +23,8 @@ protected LyricPlacementColumn(Singer singer)
this.singer = singer;
}

[BackgroundDependencyLoader(true)]
private void load(OverlayColourProvider colourProvider, [CanBeNull] KaraokeHitObjectComposer composer)
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
InternalChildren = new Drawable[]
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public partial class DrawableDragFile : Container

private RoundedButton importButton;

[BackgroundDependencyLoader(true)]
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Masking = true;
Expand Down
5 changes: 2 additions & 3 deletions osu.Game.Rulesets.Karaoke/UI/NotePlayfield.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.

using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
Expand Down Expand Up @@ -211,8 +210,8 @@ internal void OnNewResult(DrawableHitObject judgedObject, JudgementResult result
explosion.Delay(200).Expire(true);
}

[BackgroundDependencyLoader(true)]
private void load([CanBeNull] KaraokeSessionStatics session)
[BackgroundDependencyLoader]
private void load(KaraokeSessionStatics? session)
{
session?.BindWith(KaraokeRulesetSession.ScoringPitch, scoringPitch);

Expand Down

0 comments on commit d619041

Please sign in to comment.