mirror of https://github.com/ppy/osu
Enable nullability
This commit is contained in:
parent
8b033bf9f7
commit
d20dc3668e
|
@ -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 NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
|
@ -21,8 +19,8 @@ public partial class TestSceneCommentEditor : OsuManualInputManagerTestScene
|
|||
[Cached]
|
||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
||||
|
||||
private TestCommentEditor commentEditor;
|
||||
private TestCancellableCommentEditor cancellableCommentEditor;
|
||||
private TestCommentEditor commentEditor = null!;
|
||||
private TestCancellableCommentEditor cancellableCommentEditor = null!;
|
||||
|
||||
[SetUp]
|
||||
public void SetUp() => Schedule(() =>
|
||||
|
@ -109,7 +107,7 @@ private partial class TestCommentEditor : CommentEditor
|
|||
public new Bindable<string> Current => base.Current;
|
||||
public new FillFlowContainer ButtonsContainer => base.ButtonsContainer;
|
||||
|
||||
public string CommittedText { get; private set; }
|
||||
public string? CommittedText { get; private set; }
|
||||
|
||||
public TestCommentEditor()
|
||||
{
|
||||
|
|
|
@ -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.Collections.Generic;
|
||||
using osu.Framework.Allocation;
|
||||
|
@ -19,7 +17,7 @@ namespace osu.Game.Overlays.Comments
|
|||
{
|
||||
public abstract partial class CancellableCommentEditor : CommentEditor
|
||||
{
|
||||
public Action OnCancel;
|
||||
public Action? OnCancel;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
|
|
|
@ -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.Containers;
|
||||
using osu.Framework.Graphics;
|
||||
|
@ -25,7 +23,7 @@ public abstract partial class CommentEditor : CompositeDrawable
|
|||
{
|
||||
private const int side_padding = 8;
|
||||
|
||||
public Action<string> OnCommit;
|
||||
public Action<string>? OnCommit;
|
||||
|
||||
public bool IsLoading
|
||||
{
|
||||
|
@ -39,11 +37,11 @@ public bool IsLoading
|
|||
|
||||
protected abstract LocalisableString TextBoxPlaceholder { get; }
|
||||
|
||||
protected FillFlowContainer ButtonsContainer { get; private set; }
|
||||
protected FillFlowContainer ButtonsContainer { get; private set; } = null!;
|
||||
|
||||
protected readonly Bindable<string> Current = new Bindable<string>();
|
||||
|
||||
private CommitButton commitButton;
|
||||
private CommitButton commitButton = null!;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
|
@ -80,7 +78,7 @@ private void load(OverlayColourProvider colourProvider)
|
|||
},
|
||||
new Container
|
||||
{
|
||||
Name = "Footer",
|
||||
Name = @"Footer",
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = 35,
|
||||
Padding = new MarginPadding { Horizontal = side_padding },
|
||||
|
@ -95,7 +93,7 @@ private void load(OverlayColourProvider colourProvider)
|
|||
},
|
||||
ButtonsContainer = new FillFlowContainer
|
||||
{
|
||||
Name = "Buttons",
|
||||
Name = @"Buttons",
|
||||
Anchor = Anchor.CentreRight,
|
||||
Origin = Anchor.CentreRight,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
|
@ -140,7 +138,7 @@ private partial class EditorTextBox : BasicTextBox
|
|||
|
||||
protected override Color4 SelectionColour => Color4.Gray;
|
||||
|
||||
private OsuSpriteText placeholder;
|
||||
private OsuSpriteText placeholder = null!;
|
||||
|
||||
public EditorTextBox()
|
||||
{
|
||||
|
@ -181,11 +179,11 @@ private partial class CommitButton : LoadingButton
|
|||
private readonly LocalisableString text;
|
||||
|
||||
[Resolved]
|
||||
private OverlayColourProvider colourProvider { get; set; }
|
||||
private OverlayColourProvider colourProvider { get; set; } = null!;
|
||||
|
||||
private OsuSpriteText drawableText;
|
||||
private Box background;
|
||||
private Box blockedBackground;
|
||||
private OsuSpriteText drawableText = null!;
|
||||
private Box background = null!;
|
||||
private Box blockedBackground = null!;
|
||||
|
||||
public CommitButton(LocalisableString text)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue