Fix InspectCode errors

This commit is contained in:
Alden Wu 2022-09-18 18:32:33 -07:00
parent 06178104c8
commit 0138663bdc
5 changed files with 15 additions and 10 deletions

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using System.Diagnostics;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Rendering; using osu.Framework.Graphics.Rendering;
using osuTK.Graphics; using osuTK.Graphics;
@ -47,6 +46,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
color.A = alpha; color.A = alpha;
double timeDoingFadeOut = fadeOutTime - pointTime; double timeDoingFadeOut = fadeOutTime - pointTime;
if (timeDoingFadeOut > 0) if (timeDoingFadeOut > 0)
{ {
float fraction = Math.Clamp((float)(1 - (timeDoingFadeOut / fade_out_duration)), 0, 1); float fraction = Math.Clamp((float)(1 - (timeDoingFadeOut / fade_out_duration)), 0, 1);

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using System.Diagnostics;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Rendering; using osu.Framework.Graphics.Rendering;
using osu.Game.Skinning; using osu.Game.Skinning;
@ -31,7 +30,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
} }
} }
private ISkin skin; private readonly ISkin skin;
public LegacySmoke(ISkin skin) public LegacySmoke(ISkin skin)
{ {

View File

@ -28,6 +28,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
public IShader? RoundedTextureShader { get; private set; } public IShader? RoundedTextureShader { get; private set; }
private float radius = 1; private float radius = 1;
protected float Radius protected float Radius
{ {
get => radius; get => radius;
@ -41,8 +42,8 @@ namespace osu.Game.Rulesets.Osu.Skinning
} }
} }
private int rotationSeed = RNG.Next(); private int rotationSeed = RNG.Next();
protected int RotationSeed protected int RotationSeed
{ {
get => rotationSeed; get => rotationSeed;
@ -57,6 +58,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
} }
private Texture? texture; private Texture? texture;
protected Texture? Texture protected Texture? Texture
{ {
get => texture; get => texture;
@ -68,6 +70,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
} }
private double smokeTimeStart = double.MinValue; private double smokeTimeStart = double.MinValue;
protected double SmokeStartTime protected double SmokeStartTime
{ {
get => smokeTimeStart; get => smokeTimeStart;
@ -82,6 +85,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
} }
private double smokeTimeEnd = double.MaxValue; private double smokeTimeEnd = double.MaxValue;
protected double SmokeEndTime protected double SmokeEndTime
{ {
get => smokeTimeEnd; get => smokeTimeEnd;
@ -106,6 +110,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
} }
private Vector2 topLeft; private Vector2 topLeft;
protected Vector2 TopLeft protected Vector2 TopLeft
{ {
get => topLeft; get => topLeft;
@ -115,11 +120,12 @@ namespace osu.Game.Rulesets.Osu.Skinning
return; return;
topLeft = value; topLeft = value;
Invalidate(Invalidation.All); Invalidate();
} }
} }
private Vector2 bottomRight; private Vector2 bottomRight;
protected Vector2 BottomRight protected Vector2 BottomRight
{ {
get => bottomRight; get => bottomRight;
@ -140,7 +146,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
protected readonly List<SmokePoint> SmokePoints = new List<SmokePoint>(); protected readonly List<SmokePoint> SmokePoints = new List<SmokePoint>();
private float totalDistance; private float totalDistance;
private Vector2? lastPosition = null; private Vector2? lastPosition;
private const double max_duration = 60_000; private const double max_duration = 60_000;
@ -216,6 +222,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
} }
totalDistance %= PointInterval; totalDistance %= PointInterval;
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
SmokePoints.Add(new SmokePoint SmokePoints.Add(new SmokePoint
@ -335,7 +342,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
private int rotationSeed; private int rotationSeed;
private Random rotationRNG = new Random(); private Random rotationRNG = new Random();
public SmokeDrawNode(ITexturedShaderDrawable source) protected SmokeDrawNode(ITexturedShaderDrawable source)
: base(source) : base(source)
{ {
} }

View File

@ -32,7 +32,6 @@ namespace osu.Game.Rulesets.Osu.UI
public class OsuPlayfield : Playfield public class OsuPlayfield : Playfield
{ {
private readonly PlayfieldBorder playfieldBorder; private readonly PlayfieldBorder playfieldBorder;
private readonly SmokeContainer smokeContainer;
private readonly ProxyContainer approachCircles; private readonly ProxyContainer approachCircles;
private readonly ProxyContainer spinnerProxies; private readonly ProxyContainer spinnerProxies;
private readonly JudgementContainer<DrawableOsuJudgement> judgementLayer; private readonly JudgementContainer<DrawableOsuJudgement> judgementLayer;
@ -55,7 +54,7 @@ namespace osu.Game.Rulesets.Osu.UI
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {
playfieldBorder = new PlayfieldBorder { RelativeSizeAxes = Axes.Both }, playfieldBorder = new PlayfieldBorder { RelativeSizeAxes = Axes.Both },
smokeContainer = new SmokeContainer { RelativeSizeAxes = Axes.Both }, new SmokeContainer { RelativeSizeAxes = Axes.Both },
spinnerProxies = new ProxyContainer { RelativeSizeAxes = Axes.Both }, spinnerProxies = new ProxyContainer { RelativeSizeAxes = Axes.Both },
FollowPoints = new FollowPointRenderer { RelativeSizeAxes = Axes.Both }, FollowPoints = new FollowPointRenderer { RelativeSizeAxes = Axes.Both },
judgementLayer = new JudgementContainer<DrawableOsuJudgement> { RelativeSizeAxes = Axes.Both }, judgementLayer = new JudgementContainer<DrawableOsuJudgement> { RelativeSizeAxes = Axes.Both },

View File

@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Osu.UI
public event Action<Vector2, double>? SmokeMoved; public event Action<Vector2, double>? SmokeMoved;
public event Action<double>? SmokeEnded; public event Action<double>? SmokeEnded;
private bool isSmoking = false; private bool isSmoking;
public override bool ReceivePositionalInputAt(Vector2 _) => true; public override bool ReceivePositionalInputAt(Vector2 _) => true;