1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-06 08:22:56 +08:00

Merge pull request #22194 from Feodor0090/more-editor-nrt

Enable nullability for setup, design and timing editor screens
This commit is contained in:
Dean Herbert 2023-01-14 18:11:46 +09:00 committed by GitHub
commit a6e7efa62c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 88 additions and 150 deletions

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
namespace osu.Game.Screens.Edit.Design namespace osu.Game.Screens.Edit.Design
{ {
public partial class DesignScreen : EditorScreen public partial class DesignScreen : EditorScreen

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Localisation; using osu.Framework.Localisation;
@ -15,7 +13,7 @@ namespace osu.Game.Screens.Edit.Setup
{ {
public override LocalisableString Title => EditorSetupStrings.ColoursHeader; public override LocalisableString Title => EditorSetupStrings.ColoursHeader;
private LabelledColourPalette comboColours; private LabelledColourPalette comboColours = null!;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
@ -19,16 +17,16 @@ namespace osu.Game.Screens.Edit.Setup
{ {
internal partial class DesignSection : SetupSection internal partial class DesignSection : SetupSection
{ {
protected LabelledSwitchButton EnableCountdown; protected LabelledSwitchButton EnableCountdown = null!;
protected FillFlowContainer CountdownSettings; protected FillFlowContainer CountdownSettings = null!;
protected LabelledEnumDropdown<CountdownType> CountdownSpeed; protected LabelledEnumDropdown<CountdownType> CountdownSpeed = null!;
protected LabelledNumberBox CountdownOffset; protected LabelledNumberBox CountdownOffset = null!;
private LabelledSwitchButton widescreenSupport; private LabelledSwitchButton widescreenSupport = null!;
private LabelledSwitchButton epilepsyWarning; private LabelledSwitchButton epilepsyWarning = null!;
private LabelledSwitchButton letterboxDuringBreaks; private LabelledSwitchButton letterboxDuringBreaks = null!;
private LabelledSwitchButton samplesMatchPlaybackRate; private LabelledSwitchButton samplesMatchPlaybackRate = null!;
public override LocalisableString Title => EditorSetupStrings.DesignHeader; 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. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
@ -17,10 +15,10 @@ namespace osu.Game.Screens.Edit.Setup
{ {
internal partial class DifficultySection : SetupSection internal partial class DifficultySection : SetupSection
{ {
private LabelledSliderBar<float> circleSizeSlider; private LabelledSliderBar<float> circleSizeSlider = null!;
private LabelledSliderBar<float> healthDrainSlider; private LabelledSliderBar<float> healthDrainSlider = null!;
private LabelledSliderBar<float> approachRateSlider; private LabelledSliderBar<float> approachRateSlider = null!;
private LabelledSliderBar<float> overallDifficultySlider; private LabelledSliderBar<float> overallDifficultySlider = null!;
public override LocalisableString Title => EditorSetupStrings.DifficultyHeader; 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. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Graphics.UserInterfaceV2;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using osu.Framework.Extensions; using osu.Framework.Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -30,7 +28,7 @@ namespace osu.Game.Screens.Edit.Setup
internal partial class PopoverTextBox : OsuTextBox internal partial class PopoverTextBox : OsuTextBox
{ {
public Action OnFocused; public Action? OnFocused;
protected override bool OnDragStart(DragStartEvent e) 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. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
@ -16,16 +14,16 @@ namespace osu.Game.Screens.Edit.Setup
{ {
public partial class MetadataSection : SetupSection public partial class MetadataSection : SetupSection
{ {
protected LabelledTextBox ArtistTextBox; protected LabelledTextBox ArtistTextBox = null!;
protected LabelledTextBox RomanisedArtistTextBox; protected LabelledTextBox RomanisedArtistTextBox = null!;
protected LabelledTextBox TitleTextBox; protected LabelledTextBox TitleTextBox = null!;
protected LabelledTextBox RomanisedTitleTextBox; protected LabelledTextBox RomanisedTitleTextBox = null!;
private LabelledTextBox creatorTextBox; private LabelledTextBox creatorTextBox = null!;
private LabelledTextBox difficultyTextBox; private LabelledTextBox difficultyTextBox = null!;
private LabelledTextBox sourceTextBox; private LabelledTextBox sourceTextBox = null!;
private LabelledTextBox tagsTextBox; private LabelledTextBox tagsTextBox = null!;
public override LocalisableString Title => EditorSetupStrings.MetadataHeader; 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. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Localisation; using osu.Game.Localisation;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -18,12 +16,12 @@ namespace osu.Game.Screens.Edit.Setup
{ {
internal partial class SetupScreenHeader : OverlayHeader internal partial class SetupScreenHeader : OverlayHeader
{ {
public SetupScreenHeaderBackground Background { get; private set; } public SetupScreenHeaderBackground Background { get; private set; } = null!;
[Resolved] [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(); 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. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -18,10 +16,10 @@ namespace osu.Game.Screens.Edit.Setup
public partial class SetupScreenHeaderBackground : CompositeDrawable public partial class SetupScreenHeaderBackground : CompositeDrawable
{ {
[Resolved] [Resolved]
private OsuColour colours { get; set; } private OsuColour colours { get; set; } = null!;
[Resolved] [Resolved]
private IBindable<WorkingBeatmap> working { get; set; } private IBindable<WorkingBeatmap> working { get; set; } = null!;
private readonly Container content; private readonly Container content;

View File

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

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Graphics; using osu.Framework.Graphics;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -15,10 +13,10 @@ namespace osu.Game.Screens.Edit.Timing
{ {
internal partial class EffectSection : Section<EffectControlPoint> internal partial class EffectSection : Section<EffectControlPoint>
{ {
private LabelledSwitchButton kiai; private LabelledSwitchButton kiai = null!;
private LabelledSwitchButton omitBarLine; private LabelledSwitchButton omitBarLine = null!;
private SliderWithTextBoxInput<double> scrollSpeedSlider; private SliderWithTextBoxInput<double> scrollSpeedSlider = null!;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
@ -55,7 +53,7 @@ namespace osu.Game.Screens.Edit.Timing
private bool isRebinding; private bool isRebinding;
protected override void OnControlPointChanged(ValueChangedEvent<EffectControlPoint> point) protected override void OnControlPointChanged(ValueChangedEvent<EffectControlPoint?> point)
{ {
if (point.NewValue != null) if (point.NewValue != null)
{ {

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
@ -17,21 +15,21 @@ namespace osu.Game.Screens.Edit.Timing
{ {
internal partial class GroupSection : CompositeDrawable internal partial class GroupSection : CompositeDrawable
{ {
private LabelledTextBox textBox; private LabelledTextBox textBox = null!;
private OsuButton button; private OsuButton button = null!;
[Resolved] [Resolved]
protected Bindable<ControlPointGroup> SelectedGroup { get; private set; } protected Bindable<ControlPointGroup> SelectedGroup { get; private set; } = null!;
[Resolved] [Resolved]
protected EditorBeatmap Beatmap { get; private set; } protected EditorBeatmap Beatmap { get; private set; } = null!;
[Resolved] [Resolved]
private EditorClock clock { get; set; } private EditorClock clock { get; set; } = null!;
[Resolved(canBeNull: true)] [Resolved]
private IEditorChangeHandler changeHandler { get; set; } private IEditorChangeHandler? changeHandler { get; set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using System.Globalization; using System.Globalization;
using osu.Framework.Bindables; using osu.Framework.Bindables;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -35,7 +33,7 @@ namespace osu.Game.Screens.Edit.Timing
set => current.Current = value; set => current.Current = value;
} }
private OsuNumberBox numeratorBox; private OsuNumberBox numeratorBox = null!;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()

View File

@ -1,10 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using JetBrains.Annotations;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Audio.Sample; using osu.Framework.Audio.Sample;
@ -28,24 +25,23 @@ namespace osu.Game.Screens.Edit.Timing
{ {
public partial class MetronomeDisplay : BeatSyncedContainer public partial class MetronomeDisplay : BeatSyncedContainer
{ {
private Container swing; private Container swing = null!;
private OsuSpriteText bpmText; private OsuSpriteText bpmText = null!;
private Drawable weight; private Drawable weight = null!;
private Drawable stick; private Drawable stick = null!;
private IAdjustableClock metronomeClock; private IAdjustableClock metronomeClock = null!;
private Sample sampleTick; private Sample? sampleTick;
private Sample sampleTickDownbeat; private Sample? sampleTickDownbeat;
private Sample sampleLatch; private Sample? sampleLatch;
[CanBeNull] private ScheduledDelegate? tickPlaybackDelegate;
private ScheduledDelegate tickPlaybackDelegate;
[Resolved] [Resolved]
private OverlayColourProvider overlayColourProvider { get; set; } private OverlayColourProvider overlayColourProvider { get; set; } = null!;
public bool EnableClicking { get; set; } = true; public bool EnableClicking { get; set; } = true;
@ -225,13 +221,13 @@ namespace osu.Game.Screens.Edit.Timing
private double beatLength; private double beatLength;
private TimingControlPoint timingPoint; private TimingControlPoint timingPoint = null!;
private bool isSwinging; private bool isSwinging;
private readonly BindableInt interpolatedBpm = new BindableInt(); private readonly BindableInt interpolatedBpm = new BindableInt();
private ScheduledDelegate latchDelegate; private ScheduledDelegate? latchDelegate;
protected override void LoadComplete() protected override void LoadComplete()
{ {

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
@ -23,10 +21,10 @@ namespace osu.Game.Screens.Edit.Timing
private readonly Drawable button; private readonly Drawable button;
private Sample sample; private Sample? sample;
public Action RepeatBegan; public Action? RepeatBegan;
public Action RepeatEnded; public Action? RepeatEnded;
/// <summary> /// <summary>
/// An additive modifier for the frequency of the sample played on next actuation. /// An additive modifier for the frequency of the sample played on next actuation.
@ -61,7 +59,7 @@ namespace osu.Game.Screens.Edit.Timing
base.OnMouseUp(e); base.OnMouseUp(e);
} }
private ScheduledDelegate adjustDelegate; private ScheduledDelegate? adjustDelegate;
private double adjustDelay = initial_delay; private double adjustDelay = initial_delay;
private void beginRepeat() private void beginRepeat()

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
@ -21,9 +19,9 @@ namespace osu.Game.Screens.Edit.Timing
private readonly string label; private readonly string label;
protected Drawable Background { get; private set; } protected Drawable Background { get; private set; } = null!;
protected FillFlowContainer Content { get; private set; } protected FillFlowContainer Content { get; private set; } = null!;
public RowAttribute(ControlPoint point, string label) public RowAttribute(ControlPoint point, string label)
{ {

View File

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

View File

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

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -15,7 +13,7 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
{ {
private readonly BindableNumber<double> speedMultiplier; private readonly BindableNumber<double> speedMultiplier;
private OsuSpriteText text; private OsuSpriteText text = null!;
public DifficultyRowAttribute(DifficultyControlPoint difficulty) public DifficultyRowAttribute(DifficultyControlPoint difficulty)
: base(difficulty, "difficulty") : base(difficulty, "difficulty")

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -16,9 +14,9 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
private readonly Bindable<bool> omitBarLine; private readonly Bindable<bool> omitBarLine;
private readonly BindableNumber<double> scrollSpeed; private readonly BindableNumber<double> scrollSpeed;
private AttributeText kiaiModeBubble; private AttributeText kiaiModeBubble = null!;
private AttributeText omitBarLineBubble; private AttributeText omitBarLineBubble = null!;
private AttributeText text; private AttributeText text = null!;
public EffectRowAttribute(EffectControlPoint effect) public EffectRowAttribute(EffectControlPoint effect)
: base(effect, "effect") : base(effect, "effect")

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -13,8 +11,8 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
{ {
public partial class SampleRowAttribute : RowAttribute public partial class SampleRowAttribute : RowAttribute
{ {
private AttributeText sampleText; private AttributeText sampleText = null!;
private OsuSpriteText volumeText; private OsuSpriteText volumeText = null!;
private readonly Bindable<string> sampleBank; private readonly Bindable<string> sampleBank;
private readonly BindableNumber<int> volume; private readonly BindableNumber<int> volume;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions; using osu.Framework.Extensions;
@ -17,7 +15,7 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
{ {
private readonly BindableNumber<double> beatLength; private readonly BindableNumber<double> beatLength;
private readonly Bindable<TimeSignature> timeSignature; private readonly Bindable<TimeSignature> timeSignature;
private OsuSpriteText text; private OsuSpriteText text = null!;
public TimingRowAttribute(TimingControlPoint timing) public TimingRowAttribute(TimingControlPoint timing)
: base(timing, "timing") : base(timing, "timing")

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
@ -19,23 +17,23 @@ namespace osu.Game.Screens.Edit.Timing
internal abstract partial class Section<T> : CompositeDrawable internal abstract partial class Section<T> : CompositeDrawable
where T : ControlPoint where T : ControlPoint
{ {
private OsuCheckbox checkbox; private OsuCheckbox checkbox = null!;
private Container content; private Container content = null!;
protected FillFlowContainer Flow { get; private set; } protected FillFlowContainer Flow { get; private set; } = null!;
protected Bindable<T> ControlPoint { get; } = new Bindable<T>(); protected Bindable<T?> ControlPoint { get; } = new Bindable<T?>();
private const float header_height = 50; private const float header_height = 50;
[Resolved] [Resolved]
protected EditorBeatmap Beatmap { get; private set; } protected EditorBeatmap Beatmap { get; private set; } = null!;
[Resolved] [Resolved]
protected Bindable<ControlPointGroup> SelectedGroup { get; private set; } protected Bindable<ControlPointGroup> SelectedGroup { get; private set; } = null!;
[Resolved(canBeNull: true)] [Resolved]
protected IEditorChangeHandler ChangeHandler { get; private set; } protected IEditorChangeHandler? ChangeHandler { get; private set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OverlayColourProvider colours) private void load(OverlayColourProvider colours)
@ -128,7 +126,7 @@ namespace osu.Game.Screens.Edit.Timing
ControlPoint.BindValueChanged(OnControlPointChanged, true); ControlPoint.BindValueChanged(OnControlPointChanged, true);
} }
protected abstract void OnControlPointChanged(ValueChangedEvent<T> point); protected abstract void OnControlPointChanged(ValueChangedEvent<T?> point);
protected abstract T CreatePoint(); protected abstract T CreatePoint();
} }

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using System.Globalization; using System.Globalization;
using osu.Framework.Bindables; using osu.Framework.Bindables;

View File

@ -37,10 +37,10 @@ namespace osu.Game.Screens.Edit.Timing
[Resolved] [Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!; private OverlayColourProvider colourProvider { get; set; } = null!;
[Resolved(canBeNull: true)] [Resolved]
private Bindable<ControlPointGroup>? selectedGroup { get; set; } private Bindable<ControlPointGroup>? selectedGroup { get; set; }
[Resolved(canBeNull: true)] [Resolved]
private IBeatSyncProvider? beatSyncSource { get; set; } private IBeatSyncProvider? beatSyncSource { get; set; }
private Circle hoverLayer = null!; private Circle hoverLayer = null!;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
@ -22,7 +20,7 @@ namespace osu.Game.Screens.Edit.Timing
/// </summary> /// </summary>
public partial class TimingAdjustButton : CompositeDrawable public partial class TimingAdjustButton : CompositeDrawable
{ {
public Action<double> Action; public Action<double>? Action;
private readonly double adjustAmount; private readonly double adjustAmount;
@ -44,10 +42,10 @@ namespace osu.Game.Screens.Edit.Timing
private readonly RepeatingButtonBehaviour repeatBehaviour; private readonly RepeatingButtonBehaviour repeatBehaviour;
[Resolved] [Resolved]
private OverlayColourProvider colourProvider { get; set; } private OverlayColourProvider colourProvider { get; set; } = null!;
[Resolved] [Resolved]
private EditorBeatmap editorBeatmap { get; set; } private EditorBeatmap editorBeatmap { get; set; } = null!;
public TimingAdjustButton(double adjustAmount) public TimingAdjustButton(double adjustAmount)
{ {
@ -104,7 +102,7 @@ namespace osu.Game.Screens.Edit.Timing
if (hoveredBox == null) if (hoveredBox == null)
return false; return false;
Action(adjustAmount * hoveredBox.Multiplier); Action?.Invoke(adjustAmount * hoveredBox.Multiplier);
hoveredBox.Flash(); hoveredBox.Flash();
@ -119,6 +117,9 @@ namespace osu.Game.Screens.Edit.Timing
private readonly Box box; private readonly Box box;
private readonly OsuSpriteText text; private readonly OsuSpriteText text;
[Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!;
public IncrementBox(int index, double amount) public IncrementBox(int index, double amount)
{ {
Multiplier = Math.Sign(index) * convertMultiplier(index); Multiplier = Math.Sign(index) * convertMultiplier(index);
@ -156,9 +157,6 @@ namespace osu.Game.Screens.Edit.Timing
}; };
} }
[Resolved]
private OverlayColourProvider colourProvider { get; set; }
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -13,8 +11,8 @@ namespace osu.Game.Screens.Edit.Timing
{ {
internal partial class TimingSection : Section<TimingControlPoint> internal partial class TimingSection : Section<TimingControlPoint>
{ {
private LabelledTimeSignature timeSignature; private LabelledTimeSignature timeSignature = null!;
private BPMTextBox bpmTextEntry; private BPMTextBox bpmTextEntry = null!;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
@ -45,7 +43,7 @@ namespace osu.Game.Screens.Edit.Timing
private bool isRebinding; private bool isRebinding;
protected override void OnControlPointChanged(ValueChangedEvent<TimingControlPoint> point) protected override void OnControlPointChanged(ValueChangedEvent<TimingControlPoint?> point)
{ {
if (point.NewValue != null) if (point.NewValue != null)
{ {