1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 05:22:54 +08:00

Apply nullability to osu! skinning classes

This commit is contained in:
Dean Herbert 2022-11-09 13:36:52 +09:00
parent 20b8ab324f
commit 82ff142b1b
39 changed files with 94 additions and 163 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.Game.Skinning;
namespace osu.Game.Rulesets.Osu

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
namespace osu.Game.Rulesets.Osu
{
public enum OsuSkinComponents

View File

@ -1,9 +1,8 @@
// 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.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
@ -17,9 +16,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
public class CirclePiece : CompositeDrawable
{
[Resolved]
private DrawableHitObject drawableObject { get; set; }
private DrawableHitObject drawableObject { get; set; } = null!;
private TrianglesPiece triangles;
private TrianglesPiece triangles = null!;
public CirclePiece()
{
@ -72,7 +71,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
base.Dispose(isDisposing);
if (drawableObject != null)
if (drawableObject.IsNotNull())
drawableObject.HitObjectApplied -= onHitObjectApplied;
}
}

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,7 +16,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
private readonly IBindable<Color4> accentColour = new Bindable<Color4>();
[Resolved]
private DrawableHitObject drawableObject { get; set; }
private DrawableHitObject drawableObject { get; set; } = null!;
public DefaultApproachCircle()
: base("Gameplay/osu/approachcircle")

View File

@ -1,12 +1,11 @@
// 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 osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
@ -18,12 +17,12 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
public class DefaultSpinner : CompositeDrawable
{
private DrawableSpinner drawableSpinner;
private DrawableSpinner drawableSpinner = null!;
private OsuSpriteText bonusCounter;
private OsuSpriteText bonusCounter = null!;
private Container spmContainer;
private OsuSpriteText spmCounter;
private Container spmContainer = null!;
private OsuSpriteText spmCounter = null!;
public DefaultSpinner()
{
@ -81,8 +80,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
});
}
private IBindable<double> gainedBonus;
private IBindable<double> spinsPerMinute;
private IBindable<double> gainedBonus = null!;
private IBindable<double> spinsPerMinute = null!;
protected override void LoadComplete()
{
@ -135,7 +134,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
base.Dispose(isDisposing);
if (drawableSpinner != null)
if (drawableSpinner.IsNotNull())
drawableSpinner.ApplyCustomUpdateState -= updateStateTransforms;
}
}

View File

@ -1,12 +1,11 @@
// 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.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Utils;
@ -21,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
public class DefaultSpinnerDisc : CompositeDrawable
{
private DrawableSpinner drawableSpinner;
private DrawableSpinner drawableSpinner = null!;
private const float initial_scale = 1.3f;
private const float idle_alpha = 0.2f;
@ -30,15 +29,15 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
private Color4 normalColour;
private Color4 completeColour;
private SpinnerTicks ticks;
private SpinnerTicks ticks = null!;
private int wholeRotationCount;
private readonly BindableBool complete = new BindableBool();
private SpinnerFill fill;
private Container mainContainer;
private SpinnerCentreLayer centre;
private SpinnerBackgroundLayer background;
private SpinnerFill fill = null!;
private Container mainContainer = null!;
private SpinnerCentreLayer centre = null!;
private SpinnerBackgroundLayer background = null!;
public DefaultSpinnerDisc()
{
@ -214,7 +213,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
base.Dispose(isDisposing);
if (drawableSpinner != null)
if (drawableSpinner.IsNotNull())
drawableSpinner.ApplyCustomUpdateState -= updateStateTransforms;
}
}

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.Graphics.Lines;
using osuTK.Graphics;

View File

@ -1,9 +1,8 @@
// 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.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Objects.Drawables;
@ -15,9 +14,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
public class ExplodePiece : Container
{
[Resolved]
private DrawableHitObject drawableObject { get; set; }
private DrawableHitObject drawableObject { get; set; } = null!;
private TrianglesPiece triangles;
private TrianglesPiece triangles = null!;
public ExplodePiece()
{
@ -56,7 +55,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
base.Dispose(isDisposing);
if (drawableObject != null)
if (drawableObject.IsNotNull())
drawableObject.HitObjectApplied -= onHitObjectApplied;
}
}

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.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;

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;

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.Audio.Track;
using osu.Framework.Graphics;

View File

@ -1,10 +1,9 @@
// 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.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Objects.Drawables;
@ -46,7 +45,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
private readonly IBindable<int> indexInCurrentCombo = new Bindable<int>();
[Resolved]
private DrawableHitObject drawableObject { get; set; }
private DrawableHitObject drawableObject { get; set; } = null!;
[BackgroundDependencyLoader]
private void load()
@ -113,7 +112,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
base.Dispose(isDisposing);
if (drawableObject != null)
if (drawableObject.IsNotNull())
drawableObject.ApplyCustomUpdateState -= updateStateTransforms;
}
}

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 osuTK;

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.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;

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.Game.Rulesets.Objects.Drawables;
@ -20,10 +18,10 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
protected IBindable<Color4> AccentColourBindable { get; private set; } = null!;
private IBindable<int> pathVersion;
private IBindable<int> pathVersion = null!;
[Resolved(CanBeNull = true)]
private OsuRulesetConfigManager config { get; set; }
private OsuRulesetConfigManager? config { get; set; }
private readonly Bindable<bool> configSnakingOut = new Bindable<bool>();

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.Audio.Track;
using osu.Framework.Graphics;
@ -19,7 +17,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
public class ReverseArrowPiece : BeatSyncedContainer
{
[Resolved]
private DrawableHitObject drawableRepeat { get; set; }
private DrawableHitObject drawableRepeat { get; set; } = null!;
public ReverseArrowPiece()
{

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;

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.Allocation;
using osu.Framework.Graphics;
@ -19,11 +17,11 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
public class SpinnerCentreLayer : CompositeDrawable, IHasAccentColour
{
private DrawableSpinner spinner;
private DrawableSpinner spinner = null!;
private CirclePiece circle;
private GlowPiece glow;
private SpriteIcon symbol;
private CirclePiece circle = null!;
private GlowPiece glow = null!;
private SpriteIcon symbol = null!;
[BackgroundDependencyLoader]
private void load(DrawableHitObject drawableHitObject)

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.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;

View File

@ -1,11 +1,10 @@
// 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.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Events;
@ -23,6 +22,16 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
private readonly DrawableSpinner drawableSpinner;
private Vector2 mousePosition;
private float lastAngle;
private float currentRotation;
private bool rotationTransferred;
[Resolved(canBeNull: true)]
private IGameplayClock? gameplayClock { get; set; }
public SpinnerRotationTracker(DrawableSpinner drawableSpinner)
{
this.drawableSpinner = drawableSpinner;
@ -51,16 +60,6 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
return base.OnMouseMove(e);
}
private Vector2 mousePosition;
private float lastAngle;
private float currentRotation;
private bool rotationTransferred;
[Resolved(canBeNull: true)]
private IGameplayClock gameplayClock { get; set; }
protected override void Update()
{
base.Update();
@ -126,7 +125,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
base.Dispose(isDisposing);
if (drawableSpinner != null)
if (drawableSpinner.IsNotNull())
drawableSpinner.HitObjectApplied -= resetState;
}
}

View File

@ -1,12 +1,11 @@
// 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 System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Utils;
using osu.Game.Rulesets.Objects.Drawables;
@ -26,7 +25,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
private readonly Bindable<double> result = new BindableDouble();
[Resolved]
private DrawableHitObject drawableSpinner { get; set; }
private DrawableHitObject drawableSpinner { get; set; } = null!;
protected override void LoadComplete()
{
@ -66,7 +65,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
base.Dispose(isDisposing);
if (drawableSpinner != null)
if (drawableSpinner.IsNotNull())
drawableSpinner.HitObjectApplied -= resetState;
}

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.Linq;
using osu.Framework.Extensions.Color4Extensions;

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.Graphics.Backgrounds;
namespace osu.Game.Rulesets.Osu.Skinning.Default

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.Graphics;
namespace osu.Game.Rulesets.Osu.Skinning
@ -15,6 +13,6 @@ namespace osu.Game.Rulesets.Osu.Skinning
/// <summary>
/// The approach circle drawable.
/// </summary>
Drawable ApproachCircle { get; }
Drawable? ApproachCircle { get; }
}
}

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,7 +16,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
private readonly IBindable<Color4> accentColour = new Bindable<Color4>();
[Resolved]
private DrawableHitObject drawableObject { get; set; }
private DrawableHitObject drawableObject { get; set; } = null!;
public LegacyApproachCircle()
: base("Gameplay/osu/approachcircle")

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.Game.Rulesets.Osu.UI.Cursor;

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.Linq;
using osu.Framework.Allocation;
@ -27,19 +25,19 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
{
public class LegacyCursorParticles : CompositeDrawable, IKeyBindingHandler<OsuAction>
{
public bool Active => breakSpewer?.Active.Value == true || kiaiSpewer?.Active.Value == true;
public bool Active => breakSpewer.Active.Value || kiaiSpewer.Active.Value;
private LegacyCursorParticleSpewer breakSpewer;
private LegacyCursorParticleSpewer kiaiSpewer;
private LegacyCursorParticleSpewer breakSpewer = null!;
private LegacyCursorParticleSpewer kiaiSpewer = null!;
[Resolved(canBeNull: true)]
private Player player { get; set; }
private Player? player { get; set; }
[Resolved(canBeNull: true)]
private OsuPlayfield playfield { get; set; }
private OsuPlayfield? playfield { get; set; }
[Resolved(canBeNull: true)]
private GameplayState gameplayState { get; set; }
private GameplayState? gameplayState { get; set; }
[BackgroundDependencyLoader]
private void load(ISkinSource skin)
@ -79,7 +77,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
{
if (playfield == null || gameplayState == null) return;
DrawableHitObject kiaiHitObject = null;
DrawableHitObject? kiaiHitObject = null;
// Check whether currently in a kiai section first. This is only done as an optimisation to avoid enumerating AliveObjects when not necessary.
if (gameplayState.Beatmap.ControlPointInfo.EffectPointAt(Time.Current).KiaiMode)
@ -152,7 +150,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
protected override bool CanSpawnParticles => base.CanSpawnParticles && cursorScreenPosition.HasValue;
protected override float ParticleGravity => 240;
public LegacyCursorParticleSpewer(Texture texture, int perSecond)
public LegacyCursorParticleSpewer(Texture? texture, int perSecond)
: base(texture, perSecond, particle_duration_max)
{
Active.BindValueChanged(_ => resetVelocityCalculation());

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.Allocation;
using osu.Framework.Bindables;
@ -22,7 +20,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
private bool disjointTrail;
private double lastTrailTime;
private IBindable<float> cursorSize;
private IBindable<float> cursorSize = null!;
private Vector2? currentPosition;
@ -34,6 +33,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
cursorSize = config.GetBindable<float>(OsuSetting.GameplayCursorSize).GetBoundCopy();
Texture = skin.GetTexture("cursortrail");
disjointTrail = skin.GetTexture("cursormiddle") == null;
@ -54,8 +55,6 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
// stable "magic ratio". see OsuPlayfieldAdjustmentContainer for full explanation.
Texture.ScaleAdjust *= 1.6f;
}
cursorSize = config.GetBindable<float>(OsuSetting.GameplayCursorSize).GetBoundCopy();
}
protected override double FadeDuration => disjointTrail ? 150 : 500;

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;
@ -23,15 +21,15 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
/// </summary>
public class LegacyNewStyleSpinner : LegacySpinner
{
private Sprite glow;
private Sprite discBottom;
private Sprite discTop;
private Sprite spinningMiddle;
private Sprite fixedMiddle;
private Sprite glow = null!;
private Sprite discBottom = null!;
private Sprite discTop = null!;
private Sprite spinningMiddle = null!;
private Sprite fixedMiddle = null!;
private readonly Color4 glowColour = new Color4(3, 151, 255, 255);
private Container scaleContainer;
private Container scaleContainer = null!;
[BackgroundDependencyLoader]
private void load(ISkinSource source)

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.Allocation;
using osu.Framework.Graphics;
@ -23,9 +21,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
/// </summary>
public class LegacyOldStyleSpinner : LegacySpinner
{
private Sprite disc;
private Sprite metreSprite;
private Container metre;
private Sprite disc = null!;
private Sprite metreSprite = null!;
private Container metre = null!;
private bool spinnerBlink;

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.Diagnostics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@ -16,9 +14,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
public class LegacyReverseArrow : CompositeDrawable
{
[Resolved(canBeNull: true)]
private DrawableHitObject drawableHitObject { get; set; }
private DrawableHitObject? drawableHitObject { get; set; }
private Drawable proxy;
private Drawable proxy = null!;
[BackgroundDependencyLoader]
private void load(ISkinSource skinSource)

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.Color4Extensions;
using osu.Game.Rulesets.Osu.Objects;

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.Diagnostics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@ -14,9 +12,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
public class LegacySliderHeadHitCircle : LegacyMainCirclePiece
{
[Resolved(canBeNull: true)]
private DrawableHitObject drawableHitObject { get; set; }
private DrawableHitObject? drawableHitObject { get; set; }
private Drawable proxiedOverlayLayer;
private Drawable proxiedOverlayLayer = null!;
public LegacySliderHeadHitCircle()
: base("sliderstartcircle")

View File

@ -1,12 +1,11 @@
// 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 osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
@ -32,17 +31,17 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
private const float spm_hide_offset = 50f;
protected DrawableSpinner DrawableSpinner { get; private set; }
protected DrawableSpinner DrawableSpinner { get; private set; } = null!;
public Drawable ApproachCircle { get; protected set; }
public Drawable? ApproachCircle { get; protected set; }
private Sprite spin;
private Sprite clear;
private Sprite spin = null!;
private Sprite clear = null!;
private LegacySpriteText bonusCounter;
private LegacySpriteText bonusCounter = null!;
private Sprite spmBackground;
private LegacySpriteText spmCounter;
private Sprite spmBackground = null!;
private LegacySpriteText spmCounter = null!;
[BackgroundDependencyLoader]
private void load(DrawableHitObject drawableHitObject, ISkinSource source)
@ -108,8 +107,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
});
}
private IBindable<double> gainedBonus;
private IBindable<double> spinsPerMinute;
private IBindable<double> gainedBonus = null!;
private IBindable<double> spinsPerMinute = null!;
private readonly Bindable<bool> completed = new Bindable<bool>();
@ -207,7 +206,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
{
base.Dispose(isDisposing);
if (DrawableSpinner != null)
if (DrawableSpinner.IsNotNull())
DrawableSpinner.ApplyCustomUpdateState -= UpdateStateTransforms;
}
}

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.Bindables;
using osu.Framework.Graphics;
@ -30,7 +28,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
hasHitCircle = new Lazy<bool>(() => GetTexture("hitcircle") != null);
}
public override Drawable GetDrawableComponent(ISkinComponent component)
public override Drawable? GetDrawableComponent(ISkinComponent component)
{
if (component is OsuSkinComponent osuComponent)
{
@ -145,7 +143,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
return base.GetDrawableComponent(component);
}
public override IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup)
public override IBindable<TValue>? GetConfig<TLookup, TValue>(TLookup lookup)
{
switch (lookup)
{

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.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Game.Rulesets.UI;
@ -15,7 +13,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
/// </summary>
public class NonPlayfieldSprite : Sprite
{
public override Texture Texture
public override Texture? Texture
{
get => base.Texture;
set

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
namespace osu.Game.Rulesets.Osu.Skinning
{
public enum OsuSkinColour

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
namespace osu.Game.Rulesets.Osu.Skinning
{
public enum OsuSkinConfiguration

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.Collections.Generic;
using osu.Framework.Allocation;
@ -55,7 +53,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
/// </summary>
private Vector2 snakedPathOffset;
private DrawableSlider drawableSlider;
private DrawableSlider drawableSlider = null!;
[BackgroundDependencyLoader]
private void load(DrawableHitObject drawableObject)
@ -67,7 +65,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
public void UpdateProgress(double completionProgress)
{
if (drawableSlider?.HitObject == null)
if (drawableSlider.HitObject == null)
return;
Slider slider = drawableSlider.HitObject;
@ -96,7 +94,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
public void Refresh()
{
if (drawableSlider?.HitObject == null)
if (drawableSlider.HitObject == null)
return;
// Generate the entire curve