Apply NRT to all simple auxiliary skin classes

This commit is contained in:
Dean Herbert 2023-01-26 17:52:49 +09:00
parent 2017ac1135
commit 4352c56c3e
7 changed files with 8 additions and 24 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
using JetBrains.Annotations; using JetBrains.Annotations;
using osu.Framework.Bindables; using osu.Framework.Bindables;
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 System; using System;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;

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.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Screens.Play.HUD; using osu.Game.Screens.Play.HUD;

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.Globalization; using System.Globalization;
using osu.Game.Beatmaps.Formats; using osu.Game.Beatmaps.Formats;

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.Threading.Tasks; using System.Threading.Tasks;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
@ -16,7 +14,7 @@ namespace osu.Game.Skinning
{ {
private readonly LegacyFont font; private readonly LegacyFont font;
private LegacyGlyphStore glyphStore; private LegacyGlyphStore glyphStore = null!;
protected override char FixedWidthReferenceCharacter => '5'; protected override char FixedWidthReferenceCharacter => '5';
@ -49,7 +47,7 @@ namespace osu.Game.Skinning
this.skin = skin; this.skin = skin;
} }
public ITexturedCharacterGlyph Get(string fontName, char character) public ITexturedCharacterGlyph? Get(string fontName, char character)
{ {
string lookup = getLookupName(character); string lookup = getLookupName(character);
@ -79,7 +77,7 @@ namespace osu.Game.Skinning
} }
} }
public Task<ITexturedCharacterGlyph> GetAsync(string fontName, char character) => Task.Run(() => Get(fontName, character)); public Task<ITexturedCharacterGlyph?> GetAsync(string fontName, char character) => Task.Run(() => Get(fontName, character));
} }
} }
} }

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.Skinning namespace osu.Game.Skinning
{ {
public class SkinCustomColourLookup public class SkinCustomColourLookup

View File

@ -1,12 +1,9 @@
// 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.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Bindables; using osu.Framework.Bindables;
@ -39,13 +36,12 @@ namespace osu.Game.Skinning
/// <summary> /// <summary>
/// All raw <see cref="DrawableSamples"/>s contained in this <see cref="SkinnableSound"/>. /// All raw <see cref="DrawableSamples"/>s contained in this <see cref="SkinnableSound"/>.
/// </summary> /// </summary>
[NotNull, ItemNotNull]
protected IEnumerable<DrawableSample> DrawableSamples => samplesContainer.Select(c => c.Sample).Where(s => s != null); protected IEnumerable<DrawableSample> DrawableSamples => samplesContainer.Select(c => c.Sample).Where(s => s != null);
private readonly AudioContainer<PoolableSkinnableSample> samplesContainer; private readonly AudioContainer<PoolableSkinnableSample> samplesContainer;
[Resolved(CanBeNull = true)] [Resolved]
private IPooledSampleProvider samplePool { get; set; } private IPooledSampleProvider? samplePool { get; set; }
/// <summary> /// <summary>
/// Creates a new <see cref="SkinnableSound"/>. /// Creates a new <see cref="SkinnableSound"/>.
@ -59,7 +55,7 @@ namespace osu.Game.Skinning
/// Creates a new <see cref="SkinnableSound"/> with some initial samples. /// Creates a new <see cref="SkinnableSound"/> with some initial samples.
/// </summary> /// </summary>
/// <param name="samples">The initial samples.</param> /// <param name="samples">The initial samples.</param>
public SkinnableSound([NotNull] IEnumerable<ISampleInfo> samples) public SkinnableSound(IEnumerable<ISampleInfo> samples)
: this() : this()
{ {
this.samples = samples.ToArray(); this.samples = samples.ToArray();
@ -69,7 +65,7 @@ namespace osu.Game.Skinning
/// Creates a new <see cref="SkinnableSound"/> with an initial sample. /// Creates a new <see cref="SkinnableSound"/> with an initial sample.
/// </summary> /// </summary>
/// <param name="sample">The initial sample.</param> /// <param name="sample">The initial sample.</param>
public SkinnableSound([NotNull] ISampleInfo sample) public SkinnableSound(ISampleInfo sample)
: this(new[] { sample }) : this(new[] { sample })
{ {
} }
@ -79,7 +75,7 @@ namespace osu.Game.Skinning
/// <summary> /// <summary>
/// The samples that should be played. /// The samples that should be played.
/// </summary> /// </summary>
public ISampleInfo[] Samples public ISampleInfo[]? Samples
{ {
get => samples; get => samples;
set set