Skip to content

Commit

Permalink
Merge pull request #1994 from andy840119/remove-nullable-disable-anno…
Browse files Browse the repository at this point in the history
…tation-in-the-setting-page
  • Loading branch information
andy840119 authored May 9, 2023
2 parents d619041 + e8ab096 commit 4bac827
Show file tree
Hide file tree
Showing 33 changed files with 18 additions and 80 deletions.
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Karaoke/Extensions/OsuGameExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ namespace osu.Game.Rulesets.Karaoke.Extensions;
/// </summary>
public static class OsuGameExtensions
{
public static KaraokeRuleset? GetRuleset(this DependencyContainer dependencies)
public static KaraokeRuleset GetRuleset(this DependencyContainer dependencies)
{
var rulesets = dependencies.Get<RulesetStore>().AvailableRulesets.Select(info => info.CreateInstance());
return rulesets.FirstOrDefault(r => r is KaraokeRuleset) as KaraokeRuleset;
return rulesets.OfType<KaraokeRuleset>().First();
}

private static Container? getBasePlacementContainer(this OsuGame game)
Expand Down
4 changes: 1 addition & 3 deletions osu.Game.Rulesets.Karaoke/Screens/Settings/Header.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.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
Expand All @@ -25,7 +23,7 @@ public partial class Header : Container
public const float HEIGHT = 75;

[Resolved]
private KaraokeSettingsColourProvider colourProvider { get; set; }
private KaraokeSettingsColourProvider colourProvider { get; set; } = null!;

private readonly Box background;
private readonly KaraokeConfigHeaderTitle title;
Expand Down
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.Bindables;
using osu.Framework.Extensions.Color4Extensions;
Expand Down Expand Up @@ -31,7 +29,7 @@ public partial class KaraokeSettings : OsuScreen
private Bindable<SettingsSection> selectedSection = new();

[Cached]
private Bindable<SettingsSubsection> selectedSubsection = new();
private Bindable<SettingsSubsection?> selectedSubsection = new();

private readonly KaraokeConfigWaveContainer waves;
private readonly Box background;
Expand Down
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.Overlays.Settings;
using osu.Game.Rulesets.Karaoke.Screens.Settings.Sections;
Expand Down
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 System.Linq;
using osu.Framework.Allocation;
Expand All @@ -25,7 +23,7 @@ public partial class KaraokeSettingsPanel : SettingsPanel
{
public new const float WIDTH = 300;

private Box hoverBackground;
private Box hoverBackground = null!;

protected override IEnumerable<SettingsSection> CreateSections() => new SettingsSection[]
{
Expand Down Expand Up @@ -75,7 +73,7 @@ public void ScrollToSection(SettingsSection settingsSection)
public IReadOnlyList<SettingsSection> Sections => SectionsContainer.Children;

[BackgroundDependencyLoader]
private void load(KaraokeSettingsColourProvider colourProvider, Bindable<SettingsSection> selectedSection, Bindable<SettingsSubsection> selectedSubsection)
private void load(KaraokeSettingsColourProvider colourProvider, Bindable<SettingsSection> selectedSection, Bindable<SettingsSubsection?> selectedSubsection)
{
initialSelectionContainer();
initialContentContainer();
Expand Down
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.Linq;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
Expand Down
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.Bindables;
using osu.Framework.Input.Events;
Expand All @@ -15,10 +13,10 @@ namespace osu.Game.Rulesets.Karaoke.Screens.Settings;
public abstract partial class KaraokeSettingsSubsection : SettingsSubsection
{
[Resolved]
protected KaraokeRulesetConfigManager Config { get; private set; }
protected KaraokeRulesetConfigManager Config { get; private set; } = null!;

[Resolved]
private Bindable<SettingsSubsection> selectedSubsection { get; set; }
private Bindable<SettingsSubsection?> selectedSubsection { get; set; } = null!;

public virtual SettingsSubsectionPreview CreatePreview() => new UnderConstructionPreview();

Expand Down
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.Development;
using osu.Framework.Graphics;
Expand Down
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.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
Expand Down
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 System.Globalization;
using osu.Framework.Allocation;
Expand Down Expand Up @@ -31,9 +29,9 @@ public partial class LyricPreview : SettingsSubsectionPreview
private readonly Bindable<CultureInfo> preferLanguage = new();

[Resolved]
private FontStore fontStore { get; set; }
private FontStore fontStore { get; set; } = null!;

private KaraokeLocalFontStore localFontStore;
private KaraokeLocalFontStore localFontStore = null!;

private readonly DrawableLyric drawableLyric;

Expand Down
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;
Expand Down
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.Bindables;
using osu.Framework.Graphics;
Expand Down
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 @@ -36,11 +34,11 @@ public ManageFontPreview()
ShowBackground = false;
}

private EggContainer eggContainer;
private FillFlowContainer<GenerateRowContainer> textContainer;
private EggContainer eggContainer = null!;
private FillFlowContainer<GenerateRowContainer> textContainer = null!;

[BackgroundDependencyLoader]
private void load(TextureStore textures, OsuColour colours)
private void load(OsuColour colours)
{
Children = new Drawable[]
{
Expand Down Expand Up @@ -126,7 +124,7 @@ private void load(TextureStore textures, OsuColour colours)
return ("Eggs/camp-tent", 0.5f, 50);

default:
return (null, 0, 0);
return (string.Empty, 0, 0);
}
}
};
Expand Down Expand Up @@ -168,7 +166,7 @@ public partial class GenerateRowContainer : BeatSyncedContainer

private readonly GenerateDirection direction;

public Action<string> ClickedText;
public Action<string>? ClickedText;

public GenerateRowContainer(GenerateDirection direction)
{
Expand Down Expand Up @@ -268,7 +266,7 @@ static Colour4 getRandomColour()
public partial class EggContainer : BeatSyncedContainer
{
[Resolved]
private TextureStore textures { get; set; }
private TextureStore textures { get; set; } = null!;

public void GenerateEgg(string textureName, float scale, float yOffset)
{
Expand Down
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.Linq;
using ManagedBass;
using osu.Framework.Allocation;
Expand Down
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.Graphics;
using osu.Framework.Graphics.Containers;
Expand Down
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.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
Expand Down
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.Sprites;
using osu.Framework.Localisation;
Expand Down
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.Localisation;
using osu.Game.Overlays.Settings;
Expand Down
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.Localisation;
using osu.Game.Overlays.Settings;
Expand Down
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.Localisation;
Expand Down
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.Localisation;
Expand Down
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.Globalization;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
Expand Down
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.Sprites;
Expand Down
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.Localisation;
Expand Down
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.Sprites;
Expand Down
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.Localisation;
Expand Down
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.Localisation;
Expand Down
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.Sprites;
using osu.Framework.Localisation;
Expand Down
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.Sprites;
using osu.Framework.Localisation;
Expand Down
4 changes: 1 addition & 3 deletions osu.Game.Rulesets.Karaoke/Screens/Settings/SettingsFont.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.Linq;
using osu.Framework.Bindables;
using osu.Framework.Extensions;
Expand Down Expand Up @@ -32,7 +30,7 @@ private partial class FontSelectionButton : CompositeDrawable, IHasCurrentValue<
private const float height = 30;

private readonly BindableWithCurrent<FontUsage> current = new();
private BindableFontUsage bindableFontUsage;
private BindableFontUsage? bindableFontUsage;

private readonly GridContainer grid;
private readonly SettingsButton fontButton;
Expand Down
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.Globalization;
using osu.Framework.Bindables;
using osu.Framework.Extensions;
Expand Down
Loading

0 comments on commit 4bac827

Please sign in to comment.