1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 07:23:14 +08:00

Enable nullability for setup screen

This commit is contained in:
ansel 2023-01-14 02:24:28 +03:00
parent 78adaa9b03
commit 4b42240fba
11 changed files with 30 additions and 52 deletions

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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.Graphics;
using osu.Framework.Localisation;
@ -15,7 +13,7 @@ namespace osu.Game.Screens.Edit.Setup
{
public override LocalisableString Title => EditorSetupStrings.ColoursHeader;
private LabelledColourPalette comboColours;
private LabelledColourPalette comboColours = null!;
[BackgroundDependencyLoader]
private void load()

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using System;
using System.Globalization;
using System.Linq;
@ -19,16 +17,16 @@ namespace osu.Game.Screens.Edit.Setup
{
internal partial class DesignSection : SetupSection
{
protected LabelledSwitchButton EnableCountdown;
protected LabelledSwitchButton EnableCountdown = null!;
protected FillFlowContainer CountdownSettings;
protected LabelledEnumDropdown<CountdownType> CountdownSpeed;
protected LabelledNumberBox CountdownOffset;
protected FillFlowContainer CountdownSettings = null!;
protected LabelledEnumDropdown<CountdownType> CountdownSpeed = null!;
protected LabelledNumberBox CountdownOffset = null!;
private LabelledSwitchButton widescreenSupport;
private LabelledSwitchButton epilepsyWarning;
private LabelledSwitchButton letterboxDuringBreaks;
private LabelledSwitchButton samplesMatchPlaybackRate;
private LabelledSwitchButton widescreenSupport = null!;
private LabelledSwitchButton epilepsyWarning = null!;
private LabelledSwitchButton letterboxDuringBreaks = null!;
private LabelledSwitchButton samplesMatchPlaybackRate = null!;
public override LocalisableString Title => EditorSetupStrings.DesignHeader;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT 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.Bindables;
@ -17,10 +15,10 @@ namespace osu.Game.Screens.Edit.Setup
{
internal partial class DifficultySection : SetupSection
{
private LabelledSliderBar<float> circleSizeSlider;
private LabelledSliderBar<float> healthDrainSlider;
private LabelledSliderBar<float> approachRateSlider;
private LabelledSliderBar<float> overallDifficultySlider;
private LabelledSliderBar<float> circleSizeSlider = null!;
private LabelledSliderBar<float> healthDrainSlider = null!;
private LabelledSliderBar<float> approachRateSlider = null!;
private LabelledSliderBar<float> overallDifficultySlider = null!;
public override LocalisableString Title => EditorSetupStrings.DifficultyHeader;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Game.Beatmaps;
using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics.UserInterfaceV2;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using System;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
@ -30,7 +28,7 @@ namespace osu.Game.Screens.Edit.Setup
internal partial class PopoverTextBox : OsuTextBox
{
public Action OnFocused;
public Action? OnFocused;
protected override bool OnDragStart(DragStartEvent e)
{

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT 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.UserInterface;
@ -16,16 +14,16 @@ namespace osu.Game.Screens.Edit.Setup
{
public partial class MetadataSection : SetupSection
{
protected LabelledTextBox ArtistTextBox;
protected LabelledTextBox RomanisedArtistTextBox;
protected LabelledTextBox ArtistTextBox = null!;
protected LabelledTextBox RomanisedArtistTextBox = null!;
protected LabelledTextBox TitleTextBox;
protected LabelledTextBox RomanisedTitleTextBox;
protected LabelledTextBox TitleTextBox = null!;
protected LabelledTextBox RomanisedTitleTextBox = null!;
private LabelledTextBox creatorTextBox;
private LabelledTextBox difficultyTextBox;
private LabelledTextBox sourceTextBox;
private LabelledTextBox tagsTextBox;
private LabelledTextBox creatorTextBox = null!;
private LabelledTextBox difficultyTextBox = null!;
private LabelledTextBox sourceTextBox = null!;
private LabelledTextBox tagsTextBox = null!;
public override LocalisableString Title => EditorSetupStrings.MetadataHeader;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Localisation;
using osu.Game.Rulesets;
using osu.Game.Localisation;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT 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.Graphics;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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.Extensions.LocalisationExtensions;
using osu.Framework.Graphics;
@ -18,12 +16,12 @@ namespace osu.Game.Screens.Edit.Setup
{
internal partial class SetupScreenHeader : OverlayHeader
{
public SetupScreenHeaderBackground Background { get; private set; }
public SetupScreenHeaderBackground Background { get; private set; } = null!;
[Resolved]
private SectionsContainer<SetupSection> sections { get; set; }
private SectionsContainer<SetupSection> sections { get; set; } = null!;
private SetupScreenTabControl tabControl;
private SetupScreenTabControl tabControl = null!;
protected override OverlayTitle CreateTitle() => new SetupScreenTitle();

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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.Graphics;
@ -18,10 +16,10 @@ namespace osu.Game.Screens.Edit.Setup
public partial class SetupScreenHeaderBackground : CompositeDrawable
{
[Resolved]
private OsuColour colours { get; set; }
private OsuColour colours { get; set; } = null!;
[Resolved]
private IBindable<WorkingBeatmap> working { get; set; }
private IBindable<WorkingBeatmap> working { get; set; } = null!;
private readonly Container content;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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.Graphics;
using osu.Framework.Graphics.Containers;
@ -16,7 +14,7 @@ namespace osu.Game.Screens.Edit.Setup
{
public abstract partial class SetupSection : Container
{
private FillFlowContainer flow;
private FillFlowContainer flow = null!;
/// <summary>
/// Used to align some of the child <see cref="LabelledDrawable{T}"/>s together to achieve a grid-like look.
@ -24,10 +22,10 @@ namespace osu.Game.Screens.Edit.Setup
protected const float LABEL_WIDTH = 160;
[Resolved]
protected OsuColour Colours { get; private set; }
protected OsuColour Colours { get; private set; } = null!;
[Resolved]
protected EditorBeatmap Beatmap { get; private set; }
protected EditorBeatmap Beatmap { get; private set; } = null!;
protected override Container<Drawable> Content => flow;