-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1989 from andy840119/remove-the-nullable-disable-…
…annotation-in-the-editor Remove the nullable disable annotation in the editor.
- Loading branch information
Showing
27 changed files
with
58 additions
and
116 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
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,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.Reflection; | ||
using osu.Framework.Allocation; | ||
|
@@ -18,12 +16,12 @@ namespace osu.Game.Rulesets.Karaoke.Beatmaps; | |
public partial class KaraokeBeatmapResourcesProvider : Component, IKaraokeBeatmapResourcesProvider | ||
{ | ||
[Resolved] | ||
private BeatmapManager beatmapManager { get; set; } | ||
private BeatmapManager beatmapManager { get; set; } = null!; | ||
|
||
[Resolved] | ||
private IBindable<WorkingBeatmap> working { get; set; } | ||
private IBindable<WorkingBeatmap> working { get; set; } = null!; | ||
|
||
public Texture GetSingerAvatar(ISinger singer) | ||
public Texture? GetSingerAvatar(ISinger singer) | ||
{ | ||
var provider = getBeatmapResourceProvider(); | ||
if (provider == null) | ||
|
@@ -36,11 +34,11 @@ public Texture GetSingerAvatar(ISinger singer) | |
if (beatmapSetInfo == null) | ||
return null; | ||
|
||
string path = beatmapSetInfo.GetPathForFile($"assets/singers/{s.AvatarFile}"); | ||
string? path = beatmapSetInfo.GetPathForFile($"assets/singers/{s.AvatarFile}"); | ||
return provider.LargeTextureStore.Get(path); | ||
} | ||
|
||
private IBeatmapResourceProvider getBeatmapResourceProvider() | ||
private IBeatmapResourceProvider? getBeatmapResourceProvider() | ||
{ | ||
// todo : use better way to get the resource provider. | ||
var prop = typeof(BeatmapManager).GetField("workingBeatmapCache", BindingFlags.Instance | BindingFlags.NonPublic); | ||
|
2 changes: 0 additions & 2 deletions
2
osu.Game.Rulesets.Karaoke/Edit/Blueprints/KaraokeSelectionBlueprint.cs
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,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 osu.Framework.Graphics; | ||
using osu.Game.Rulesets.Edit; | ||
using osu.Game.Rulesets.Karaoke.Objects; | ||
|
2 changes: 0 additions & 2 deletions
2
osu.Game.Rulesets.Karaoke/Edit/Blueprints/Lyrics/LyricSelectionBlueprint.cs
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,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 osu.Game.Rulesets.Karaoke.Objects; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Edit.Blueprints.Lyrics; | ||
|
2 changes: 0 additions & 2 deletions
2
osu.Game.Rulesets.Karaoke/Edit/Blueprints/Notes/Components/EditBodyPiece.cs
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,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 osu.Framework.Allocation; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
|
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,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 osu.Framework.Allocation; | ||
using osu.Framework.Extensions; | ||
using osu.Framework.Graphics; | ||
|
@@ -25,22 +23,22 @@ namespace osu.Game.Rulesets.Karaoke.Edit.Blueprints.Notes; | |
public partial class NoteSelectionBlueprint : KaraokeSelectionBlueprint<Note>, IHasPopover | ||
{ | ||
[Resolved] | ||
private INotesChangeHandler notesChangeHandler { get; set; } | ||
private INotesChangeHandler notesChangeHandler { get; set; } = null!; | ||
|
||
[Resolved] | ||
private INotePropertyChangeHandler notePropertyChangeHandler { get; set; } | ||
private INotePropertyChangeHandler notePropertyChangeHandler { get; set; } = null!; | ||
|
||
[Resolved] | ||
private Playfield playfield { get; set; } | ||
private Playfield playfield { get; set; } = null!; | ||
|
||
[Resolved] | ||
private IScrollingInfo scrollingInfo { get; set; } | ||
private IScrollingInfo scrollingInfo { get; set; } = null!; | ||
|
||
[Resolved] | ||
private INotePositionInfo notePositionInfo { get; set; } | ||
private INotePositionInfo notePositionInfo { get; set; } = null!; | ||
|
||
[Resolved] | ||
private EditorBeatmap beatmap { get; set; } | ||
private EditorBeatmap beatmap { get; set; } = null!; | ||
|
||
protected ScrollingHitObjectContainer HitObjectContainer => ((KaraokePlayfield)playfield).NotePlayfield.HitObjectContainer; | ||
|
||
|
2 changes: 0 additions & 2 deletions
2
osu.Game.Rulesets.Karaoke/Edit/Components/Containers/Section.cs
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,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 osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Framework.Localisation; | ||
|
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,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.Linq; | ||
using osu.Game.Graphics.UserInterface; | ||
|
@@ -17,7 +15,7 @@ namespace osu.Game.Rulesets.Karaoke.Edit.Components.ContextMenu; | |
|
||
public class SingerContextMenu : OsuMenuItem | ||
{ | ||
public SingerContextMenu(EditorBeatmap beatmap, ILyricSingerChangeHandler lyricSingerChangeHandler, string name, Action postProcess = null) | ||
public SingerContextMenu(EditorBeatmap beatmap, ILyricSingerChangeHandler lyricSingerChangeHandler, string name, Action? postProcess = null) | ||
: base(name) | ||
{ | ||
var lyrics = beatmap.SelectedHitObjects.OfType<Lyric>().ToArray(); | ||
|
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,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 osu.Framework.Allocation; | ||
using osu.Game.Rulesets.Karaoke.Edit.Components.Sprites; | ||
using osu.Game.Rulesets.Karaoke.Graphics.Cursor; | ||
|
@@ -19,8 +17,8 @@ public partial class LayoutToolTip : BackgroundToolTip<Lyric> | |
|
||
private readonly DrawableLayoutPreview preview; | ||
|
||
[Resolved(canBeNull: true)] | ||
private ISkinSource skinSource { get; set; } | ||
[Resolved] | ||
private ISkinSource? skinSource { get; set; } | ||
|
||
public LayoutToolTip() | ||
{ | ||
|
@@ -30,7 +28,7 @@ public LayoutToolTip() | |
}; | ||
} | ||
|
||
private Lyric lastLyric; | ||
private Lyric? lastLyric; | ||
|
||
public override void SetContent(Lyric lyric) | ||
{ | ||
|
@@ -40,7 +38,7 @@ public override void SetContent(Lyric lyric) | |
lastLyric = lyric; | ||
|
||
// Get layout | ||
var layout = skinSource?.GetConfig<Lyric, LyricLayout>(lyric).Value; | ||
var layout = skinSource?.GetConfig<Lyric, LyricLayout>(lyric)?.Value; | ||
|
||
// Display in content | ||
preview.Layout = layout; | ||
|
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,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 osu.Framework.Allocation; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
|
@@ -20,7 +18,7 @@ public partial class TimeTagTooltip : BackgroundToolTip<TimeTag> | |
{ | ||
private const int time_display_height = 25; | ||
|
||
private Box background; | ||
private Box background = null!; | ||
private readonly OsuSpriteText trackTimer; | ||
private readonly OsuSpriteText index; | ||
private readonly OsuSpriteText indexState; | ||
|
@@ -84,7 +82,7 @@ protected override Drawable SetBackground() | |
}; | ||
} | ||
|
||
private TimeTag lastTimeTag; | ||
private TimeTag? lastTimeTag; | ||
|
||
public override void SetContent(TimeTag timeTag) | ||
{ | ||
|
2 changes: 0 additions & 2 deletions
2
osu.Game.Rulesets.Karaoke/Edit/Components/Menus/KaraokeEditorMenu.cs
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,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 osu.Framework.Graphics.UserInterface; | ||
using osu.Framework.Screens; | ||
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps; | ||
|
2 changes: 0 additions & 2 deletions
2
osu.Game.Rulesets.Karaoke/Edit/Components/Menus/KaraokeSkinEditorMenu.cs
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,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 osu.Framework.Graphics.UserInterface; | ||
using osu.Framework.Screens; | ||
using osu.Game.Rulesets.Karaoke.Screens.Skin; | ||
|
2 changes: 0 additions & 2 deletions
2
osu.Game.Rulesets.Karaoke/Edit/Components/Menus/NoteEditorPreviewMenu.cs
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,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 osu.Framework.Bindables; | ||
using osu.Framework.Graphics.UserInterface; | ||
using osu.Game.Graphics.UserInterface; | ||
|
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,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 osu.Framework.Allocation; | ||
using osu.Framework.Extensions.EnumExtensions; | ||
using osu.Framework.Graphics; | ||
|
@@ -24,8 +22,8 @@ public partial class DrawableLayoutPreview : CompositeDrawable | |
private readonly Box previewLyric; | ||
private readonly OsuSpriteText notSupportText; | ||
|
||
[Resolved(canBeNull: true)] | ||
private ISkinSource skinSource { get; set; } | ||
[Resolved] | ||
private ISkinSource? skinSource { get; set; } | ||
|
||
public DrawableLayoutPreview() | ||
{ | ||
|
@@ -50,9 +48,9 @@ public DrawableLayoutPreview() | |
notSupportText.Hide(); | ||
} | ||
|
||
private LyricLayout layout; | ||
private LyricLayout? layout; | ||
|
||
public LyricLayout Layout | ||
public LyricLayout? Layout | ||
{ | ||
get => layout; | ||
set | ||
|
@@ -65,9 +63,9 @@ public LyricLayout Layout | |
} | ||
} | ||
|
||
private Lyric lyric; | ||
private Lyric? lyric; | ||
|
||
public Lyric Lyric | ||
public Lyric? Lyric | ||
{ | ||
get => lyric; | ||
set | ||
|
@@ -104,19 +102,19 @@ private void updateLayout() | |
previewLyric.Height = text_size * 1.5f * scale; | ||
|
||
// Set relative position | ||
previewLyric.Anchor = layout.Alignment; | ||
previewLyric.Origin = layout.Alignment; | ||
previewLyric.Anchor = Layout.Alignment; | ||
previewLyric.Origin = Layout.Alignment; | ||
|
||
// Set margin | ||
const float padding = 30 * scale; | ||
float horizontalMargin = layout.HorizontalMargin * scale + padding; | ||
float verticalMargin = layout.VerticalMargin * scale + padding; | ||
float horizontalMargin = Layout.HorizontalMargin * scale + padding; | ||
float verticalMargin = Layout.VerticalMargin * scale + padding; | ||
previewLyric.Margin = new MarginPadding | ||
{ | ||
Left = layout.Alignment.HasFlagFast(Anchor.x0) ? horizontalMargin : 0, | ||
Right = layout.Alignment.HasFlagFast(Anchor.x2) ? horizontalMargin : 0, | ||
Top = layout.Alignment.HasFlagFast(Anchor.y0) ? verticalMargin : 0, | ||
Bottom = layout.Alignment.HasFlagFast(Anchor.y2) ? verticalMargin : 0 | ||
Left = Layout.Alignment.HasFlagFast(Anchor.x0) ? horizontalMargin : 0, | ||
Right = Layout.Alignment.HasFlagFast(Anchor.x2) ? horizontalMargin : 0, | ||
Top = Layout.Alignment.HasFlagFast(Anchor.y0) ? verticalMargin : 0, | ||
Bottom = Layout.Alignment.HasFlagFast(Anchor.y2) ? verticalMargin : 0 | ||
}; | ||
} | ||
} | ||
|
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,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 osu.Framework.Allocation; | ||
using osu.Framework.Graphics; | ||
|
@@ -42,7 +40,7 @@ public NoteEditPopover(Note note) | |
|
||
private partial class NoteSection : Section | ||
{ | ||
private INotePropertyChangeHandler notePropertyChangeHandler { get; set; } | ||
private INotePropertyChangeHandler notePropertyChangeHandler { get; set; } = null!; | ||
|
||
protected override LocalisableString Title => "Note property"; | ||
|
||
|
@@ -108,9 +106,6 @@ public NoteSection(Note note) | |
[BackgroundDependencyLoader(true)] | ||
private void load(HitObjectComposer composer) | ||
{ | ||
if (notePropertyChangeHandler != null || composer == null) | ||
return; | ||
|
||
// todo: not a good way to get change handler, might remove or found another way eventually. | ||
// cannot get change handler directly in editor screen, so should trying to get from karaoke hit object composer. | ||
notePropertyChangeHandler = composer.Dependencies.Get<INotePropertyChangeHandler>(); | ||
|
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,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.Collections.Generic; | ||
using osu.Framework.Allocation; | ||
using osu.Framework.Bindables; | ||
|
@@ -25,7 +23,7 @@ public partial class DrawableKaraokeEditorRuleset : DrawableKaraokeRuleset | |
|
||
protected override bool DisplayNotePlayfield => true; | ||
|
||
public DrawableKaraokeEditorRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods) | ||
public DrawableKaraokeEditorRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod>? mods) | ||
: base(ruleset, beatmap, mods) | ||
{ | ||
bindableDisplayRubyToggle.BindValueChanged(x => { Session.SetValue(KaraokeRulesetSession.DisplayRuby, x.NewValue); }); | ||
|
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,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 osu.Framework.Allocation; | ||
|
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,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.IO; | ||
using System.Linq; | ||
|
@@ -22,10 +20,10 @@ namespace osu.Game.Rulesets.Karaoke.Edit.Export; | |
public partial class ExportLyricManager : Component | ||
{ | ||
[Resolved] | ||
private Storage storage { get; set; } | ||
private Storage storage { get; set; } = null!; | ||
|
||
[Resolved] | ||
private EditorBeatmap beatmap { get; set; } | ||
private EditorBeatmap beatmap { get; set; } = null!; | ||
|
||
public void ExportToLrc() | ||
{ | ||
|
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,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 osu.Game.Rulesets.Edit; | ||
using osu.Game.Rulesets.Karaoke.Edit.Blueprints.Lyrics; | ||
|
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,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 osu.Game.Rulesets.Karaoke.UI; | ||
using osu.Game.Rulesets.Karaoke.UI.Scrolling; | ||
|
||
|
Oops, something went wrong.