mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Enforce readonly private members where possible.
This commit is contained in:
parent
5138890530
commit
54e1b24fe9
@ -53,7 +53,7 @@ namespace osu.Desktop.Deploy
|
|||||||
private static string nupkgFilename(string ver) => $"{PackageName}.{ver}.nupkg";
|
private static string nupkgFilename(string ver) => $"{PackageName}.{ver}.nupkg";
|
||||||
private static string nupkgDistroFilename(string ver) => $"{PackageName}-{ver}-full.nupkg";
|
private static string nupkgDistroFilename(string ver) => $"{PackageName}-{ver}-full.nupkg";
|
||||||
|
|
||||||
private static Stopwatch sw = new Stopwatch();
|
private static readonly Stopwatch sw = new Stopwatch();
|
||||||
|
|
||||||
private static string codeSigningPassword;
|
private static string codeSigningPassword;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ namespace osu.Desktop.VisualTests.Beatmaps
|
|||||||
this.beatmap = beatmap;
|
this.beatmap = beatmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Beatmap beatmap;
|
private readonly Beatmap beatmap;
|
||||||
|
|
||||||
protected override Beatmap GetBeatmap() => beatmap;
|
protected override Beatmap GetBeatmap() => beatmap;
|
||||||
protected override Texture GetBackground() => null;
|
protected override Texture GetBackground() => null;
|
||||||
|
@ -10,7 +10,7 @@ namespace osu.Desktop.VisualTests
|
|||||||
{
|
{
|
||||||
public class Benchmark : OsuGameBase
|
public class Benchmark : OsuGameBase
|
||||||
{
|
{
|
||||||
private double timePerTest = 200;
|
private readonly double timePerTest = 200;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
|
@ -21,7 +21,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
internal class TestCaseHitObjects : TestCase
|
internal class TestCaseHitObjects : TestCase
|
||||||
{
|
{
|
||||||
private FramedClock framedClock;
|
private readonly FramedClock framedClock;
|
||||||
|
|
||||||
private bool auto;
|
private bool auto;
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private HitObjectType mode = HitObjectType.Slider;
|
private HitObjectType mode = HitObjectType.Slider;
|
||||||
|
|
||||||
private BindableNumber<double> playbackSpeed = new BindableDouble(0.5) { MinValue = 0, MaxValue = 1 };
|
private readonly BindableNumber<double> playbackSpeed = new BindableDouble(0.5) { MinValue = 0, MaxValue = 1 };
|
||||||
private Container playfieldContainer;
|
private Container playfieldContainer;
|
||||||
private Container approachContainer;
|
private Container approachContainer;
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
progressingNotifications.Add(n);
|
progressingNotifications.Add(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<ProgressNotification> progressingNotifications = new List<ProgressNotification>();
|
private readonly List<ProgressNotification> progressingNotifications = new List<ProgressNotification>();
|
||||||
|
|
||||||
private void sendProgress1()
|
private void sendProgress1()
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Desktop
|
|||||||
{
|
{
|
||||||
internal class OsuGameDesktop : OsuGame
|
internal class OsuGameDesktop : OsuGame
|
||||||
{
|
{
|
||||||
private VersionManager versionManager;
|
private readonly VersionManager versionManager;
|
||||||
|
|
||||||
public OsuGameDesktop(string[] args = null)
|
public OsuGameDesktop(string[] args = null)
|
||||||
: base(args)
|
: base(args)
|
||||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Modes.Catch.Objects.Drawable
|
|||||||
{
|
{
|
||||||
internal class DrawableFruit : Sprite
|
internal class DrawableFruit : Sprite
|
||||||
{
|
{
|
||||||
private CatchBaseHit h;
|
private readonly CatchBaseHit h;
|
||||||
|
|
||||||
public DrawableFruit(CatchBaseHit h)
|
public DrawableFruit(CatchBaseHit h)
|
||||||
{
|
{
|
||||||
|
@ -13,15 +13,15 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
public class DrawableHitCircle : DrawableOsuHitObject, IDrawableHitObjectWithProxiedApproach
|
public class DrawableHitCircle : DrawableOsuHitObject, IDrawableHitObjectWithProxiedApproach
|
||||||
{
|
{
|
||||||
private OsuHitObject osuObject;
|
private readonly OsuHitObject osuObject;
|
||||||
|
|
||||||
public ApproachCircle ApproachCircle;
|
public ApproachCircle ApproachCircle;
|
||||||
private CirclePiece circle;
|
private readonly CirclePiece circle;
|
||||||
private RingPiece ring;
|
private readonly RingPiece ring;
|
||||||
private FlashPiece flash;
|
private readonly FlashPiece flash;
|
||||||
private ExplodePiece explode;
|
private readonly ExplodePiece explode;
|
||||||
private NumberPiece number;
|
private readonly NumberPiece number;
|
||||||
private GlowPiece glow;
|
private readonly GlowPiece glow;
|
||||||
|
|
||||||
public DrawableHitCircle(OsuHitObject h) : base(h)
|
public DrawableHitCircle(OsuHitObject h) : base(h)
|
||||||
{
|
{
|
||||||
|
@ -13,18 +13,18 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
public class DrawableSlider : DrawableOsuHitObject, IDrawableHitObjectWithProxiedApproach
|
public class DrawableSlider : DrawableOsuHitObject, IDrawableHitObjectWithProxiedApproach
|
||||||
{
|
{
|
||||||
private Slider slider;
|
private readonly Slider slider;
|
||||||
|
|
||||||
private DrawableHitCircle initialCircle;
|
private readonly DrawableHitCircle initialCircle;
|
||||||
|
|
||||||
private List<ISliderProgress> components = new List<ISliderProgress>();
|
private readonly List<ISliderProgress> components = new List<ISliderProgress>();
|
||||||
|
|
||||||
private Container<DrawableSliderTick> ticks;
|
private readonly Container<DrawableSliderTick> ticks;
|
||||||
|
|
||||||
private SliderBody body;
|
private readonly SliderBody body;
|
||||||
private SliderBall ball;
|
private readonly SliderBall ball;
|
||||||
|
|
||||||
private SliderBouncer bouncer2;
|
private readonly SliderBouncer bouncer2;
|
||||||
|
|
||||||
public DrawableSlider(Slider s) : base(s)
|
public DrawableSlider(Slider s) : base(s)
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
public class DrawableSliderTick : DrawableOsuHitObject
|
public class DrawableSliderTick : DrawableOsuHitObject
|
||||||
{
|
{
|
||||||
private SliderTick sliderTick;
|
private readonly SliderTick sliderTick;
|
||||||
|
|
||||||
public double FadeInTime;
|
public double FadeInTime;
|
||||||
public double FadeOutTime;
|
public double FadeOutTime;
|
||||||
|
@ -15,12 +15,12 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
public class DrawableSpinner : DrawableOsuHitObject
|
public class DrawableSpinner : DrawableOsuHitObject
|
||||||
{
|
{
|
||||||
private Spinner spinner;
|
private readonly Spinner spinner;
|
||||||
|
|
||||||
private SpinnerDisc disc;
|
private readonly SpinnerDisc disc;
|
||||||
private SpinnerBackground background;
|
private readonly SpinnerBackground background;
|
||||||
private Container circleContainer;
|
private readonly Container circleContainer;
|
||||||
private DrawableHitCircle circle;
|
private readonly DrawableHitCircle circle;
|
||||||
|
|
||||||
public DrawableSpinner(Spinner s) : base(s)
|
public DrawableSpinner(Spinner s) : base(s)
|
||||||
{
|
{
|
||||||
@ -108,7 +108,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
|
|
||||||
private Vector2 scaleToCircle => circle.Scale * circle.DrawWidth / DrawWidth * 0.95f;
|
private Vector2 scaleToCircle => circle.Scale * circle.DrawWidth / DrawWidth * 0.95f;
|
||||||
|
|
||||||
private float spinsPerMinuteNeeded = 100 + 5 * 15; //TODO: read per-map OD and place it on the 5
|
private readonly float spinsPerMinuteNeeded = 100 + 5 * 15; //TODO: read per-map OD and place it on the 5
|
||||||
|
|
||||||
private float rotationsNeeded => (float)(spinsPerMinuteNeeded * (spinner.EndTime - spinner.StartTime) / 60000f);
|
private float rotationsNeeded => (float)(spinsPerMinuteNeeded * (spinner.EndTime - spinner.StartTime) / 60000f);
|
||||||
|
|
||||||
|
@ -17,8 +17,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
public class HitExplosion : FillFlowContainer
|
public class HitExplosion : FillFlowContainer
|
||||||
{
|
{
|
||||||
private readonly OsuJudgementInfo judgement;
|
private readonly OsuJudgementInfo judgement;
|
||||||
private SpriteText line1;
|
private readonly SpriteText line1;
|
||||||
private SpriteText line2;
|
private readonly SpriteText line2;
|
||||||
|
|
||||||
public HitExplosion(OsuJudgementInfo judgement, OsuHitObject h = null)
|
public HitExplosion(OsuJudgementInfo judgement, OsuHitObject h = null)
|
||||||
{
|
{
|
||||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
public class ApproachCircle : Container
|
public class ApproachCircle : Container
|
||||||
{
|
{
|
||||||
private Sprite approachCircle;
|
private readonly Sprite approachCircle;
|
||||||
|
|
||||||
public ApproachCircle()
|
public ApproachCircle()
|
||||||
{
|
{
|
||||||
|
@ -14,7 +14,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
public class CirclePiece : Container
|
public class CirclePiece : Container
|
||||||
{
|
{
|
||||||
private Sprite disc;
|
private readonly Sprite disc;
|
||||||
|
|
||||||
|
|
||||||
public Func<bool> Hit;
|
public Func<bool> Hit;
|
||||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
public class GlowPiece : Container
|
public class GlowPiece : Container
|
||||||
{
|
{
|
||||||
private Sprite layer;
|
private readonly Sprite layer;
|
||||||
|
|
||||||
public GlowPiece()
|
public GlowPiece()
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
public class NumberPiece : Container
|
public class NumberPiece : Container
|
||||||
{
|
{
|
||||||
private SpriteText number;
|
private readonly SpriteText number;
|
||||||
|
|
||||||
public string Text
|
public string Text
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
public class SliderBall : CircularContainer, ISliderProgress
|
public class SliderBall : CircularContainer, ISliderProgress
|
||||||
{
|
{
|
||||||
private readonly Slider slider;
|
private readonly Slider slider;
|
||||||
private Box follow;
|
private readonly Box follow;
|
||||||
|
|
||||||
private const float width = 128;
|
private const float width = 128;
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
public class SliderBody : Container, ISliderProgress
|
public class SliderBody : Container, ISliderProgress
|
||||||
{
|
{
|
||||||
private Path path;
|
private readonly Path path;
|
||||||
private BufferedContainer container;
|
private readonly BufferedContainer container;
|
||||||
|
|
||||||
public float PathWidth
|
public float PathWidth
|
||||||
{
|
{
|
||||||
@ -33,7 +33,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
public double? SnakedStart { get; private set; }
|
public double? SnakedStart { get; private set; }
|
||||||
public double? SnakedEnd { get; private set; }
|
public double? SnakedEnd { get; private set; }
|
||||||
|
|
||||||
private Slider slider;
|
private readonly Slider slider;
|
||||||
public SliderBody(Slider s)
|
public SliderBody(Slider s)
|
||||||
{
|
{
|
||||||
slider = s;
|
slider = s;
|
||||||
@ -122,7 +122,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
path.Texture = texture;
|
path.Texture = texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Vector2> currentCurve = new List<Vector2>();
|
private readonly List<Vector2> currentCurve = new List<Vector2>();
|
||||||
private bool updateSnaking(double p0, double p1)
|
private bool updateSnaking(double p0, double p1)
|
||||||
{
|
{
|
||||||
if (SnakedStart == p0 && SnakedEnd == p1) return false;
|
if (SnakedStart == p0 && SnakedEnd == p1) return false;
|
||||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
private readonly Slider slider;
|
private readonly Slider slider;
|
||||||
private readonly bool isEnd;
|
private readonly bool isEnd;
|
||||||
private TextAwesome icon;
|
private readonly TextAwesome icon;
|
||||||
|
|
||||||
public SliderBouncer(Slider slider, bool isEnd)
|
public SliderBouncer(Slider slider, bool isEnd)
|
||||||
{
|
{
|
||||||
|
@ -47,11 +47,11 @@ namespace osu.Game.Modes.Osu.Objects
|
|||||||
|
|
||||||
internal int MaxCombo = 1;
|
internal int MaxCombo = 1;
|
||||||
|
|
||||||
private float scalingFactor;
|
private readonly float scalingFactor;
|
||||||
private float lazySliderLength;
|
private float lazySliderLength;
|
||||||
|
|
||||||
private Vector2 startPosition;
|
private readonly Vector2 startPosition;
|
||||||
private Vector2 endPosition;
|
private readonly Vector2 endPosition;
|
||||||
|
|
||||||
internal OsuHitObjectDifficulty(OsuHitObject baseHitObject)
|
internal OsuHitObjectDifficulty(OsuHitObject baseHitObject)
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Modes.Osu
|
|||||||
|
|
||||||
private const float spin_radius = 50;
|
private const float spin_radius = 50;
|
||||||
|
|
||||||
private Beatmap<OsuHitObject> beatmap;
|
private readonly Beatmap<OsuHitObject> beatmap;
|
||||||
|
|
||||||
public OsuAutoReplay(Beatmap<OsuHitObject> beatmap)
|
public OsuAutoReplay(Beatmap<OsuHitObject> beatmap)
|
||||||
{
|
{
|
||||||
@ -37,11 +37,11 @@ namespace osu.Game.Modes.Osu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IComparer<LegacyReplayFrame> replayFrameComparer = new LegacyReplayFrameComparer();
|
private static readonly IComparer<LegacyReplayFrame> replay_frame_comparer = new LegacyReplayFrameComparer();
|
||||||
|
|
||||||
private int findInsertionIndex(LegacyReplayFrame frame)
|
private int findInsertionIndex(LegacyReplayFrame frame)
|
||||||
{
|
{
|
||||||
int index = Frames.BinarySearch(frame, replayFrameComparer);
|
int index = Frames.BinarySearch(frame, replay_frame_comparer);
|
||||||
|
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
{
|
{
|
||||||
|
@ -17,9 +17,9 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
{
|
{
|
||||||
public class OsuPlayfield : Playfield<OsuHitObject, OsuJudgementInfo>
|
public class OsuPlayfield : Playfield<OsuHitObject, OsuJudgementInfo>
|
||||||
{
|
{
|
||||||
private Container approachCircles;
|
private readonly Container approachCircles;
|
||||||
private Container judgementLayer;
|
private readonly Container judgementLayer;
|
||||||
private ConnectionRenderer<OsuHitObject> connectionLayer;
|
private readonly ConnectionRenderer<OsuHitObject> connectionLayer;
|
||||||
|
|
||||||
public override Vector2 Size
|
public override Vector2 Size
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
{
|
{
|
||||||
internal class DrawableTaikoHit : Sprite
|
internal class DrawableTaikoHit : Sprite
|
||||||
{
|
{
|
||||||
private TaikoHitObject h;
|
private readonly TaikoHitObject h;
|
||||||
|
|
||||||
public DrawableTaikoHit(TaikoHitObject h)
|
public DrawableTaikoHit(TaikoHitObject h)
|
||||||
{
|
{
|
||||||
|
@ -21,12 +21,12 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
public class BeatmapPanel : Panel
|
public class BeatmapPanel : Panel
|
||||||
{
|
{
|
||||||
public BeatmapInfo Beatmap;
|
public BeatmapInfo Beatmap;
|
||||||
private Sprite background;
|
private readonly Sprite background;
|
||||||
|
|
||||||
public Action<BeatmapPanel> GainedSelection;
|
public Action<BeatmapPanel> GainedSelection;
|
||||||
public Action<BeatmapPanel> StartRequested;
|
public Action<BeatmapPanel> StartRequested;
|
||||||
private Triangles triangles;
|
private readonly Triangles triangles;
|
||||||
private StarCounter starCounter;
|
private readonly StarCounter starCounter;
|
||||||
|
|
||||||
protected override void Selected()
|
protected override void Selected()
|
||||||
{
|
{
|
||||||
|
@ -20,11 +20,12 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
public class BeatmapSetHeader : Panel
|
public class BeatmapSetHeader : Panel
|
||||||
{
|
{
|
||||||
public Action<BeatmapSetHeader> GainedSelection;
|
public Action<BeatmapSetHeader> GainedSelection;
|
||||||
private SpriteText title, artist;
|
private readonly SpriteText title;
|
||||||
|
private readonly SpriteText artist;
|
||||||
private OsuConfigManager config;
|
private OsuConfigManager config;
|
||||||
private Bindable<bool> preferUnicode;
|
private Bindable<bool> preferUnicode;
|
||||||
private WorkingBeatmap beatmap;
|
private readonly WorkingBeatmap beatmap;
|
||||||
private FillFlowContainer difficultyIcons;
|
private readonly FillFlowContainer difficultyIcons;
|
||||||
|
|
||||||
public BeatmapSetHeader(WorkingBeatmap beatmap)
|
public BeatmapSetHeader(WorkingBeatmap beatmap)
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
|
|
||||||
public override bool RemoveWhenNotAlive => false;
|
public override bool RemoveWhenNotAlive => false;
|
||||||
|
|
||||||
private Container nestedContainer;
|
private readonly Container nestedContainer;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => nestedContainer;
|
protected override Container<Drawable> Content => nestedContainer;
|
||||||
|
|
||||||
|
@ -21,9 +21,9 @@ namespace osu.Game.Beatmaps.IO
|
|||||||
OsuLegacyDecoder.Register();
|
OsuLegacyDecoder.Register();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Stream archiveStream;
|
private readonly Stream archiveStream;
|
||||||
private ZipFile archive;
|
private readonly ZipFile archive;
|
||||||
private Beatmap firstMap;
|
private readonly Beatmap firstMap;
|
||||||
|
|
||||||
public OszArchiveReader(Stream archiveStream)
|
public OszArchiveReader(Stream archiveStream)
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Beatmaps
|
|||||||
protected abstract Track GetTrack();
|
protected abstract Track GetTrack();
|
||||||
|
|
||||||
private Beatmap beatmap;
|
private Beatmap beatmap;
|
||||||
private object beatmapLock = new object();
|
private readonly object beatmapLock = new object();
|
||||||
public Beatmap Beatmap
|
public Beatmap Beatmap
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -54,7 +54,7 @@ namespace osu.Game.Beatmaps
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private object backgroundLock = new object();
|
private readonly object backgroundLock = new object();
|
||||||
private Texture background;
|
private Texture background;
|
||||||
public Texture Background
|
public Texture Background
|
||||||
{
|
{
|
||||||
@ -68,7 +68,7 @@ namespace osu.Game.Beatmaps
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Track track;
|
private Track track;
|
||||||
private object trackLock = new object();
|
private readonly object trackLock = new object();
|
||||||
public Track Track
|
public Track Track
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Database
|
|||||||
public class BeatmapDatabase
|
public class BeatmapDatabase
|
||||||
{
|
{
|
||||||
private SQLiteConnection connection { get; }
|
private SQLiteConnection connection { get; }
|
||||||
private Storage storage;
|
private readonly Storage storage;
|
||||||
public event Action<BeatmapSetInfo> BeatmapSetAdded;
|
public event Action<BeatmapSetInfo> BeatmapSetAdded;
|
||||||
public event Action<BeatmapSetInfo> BeatmapSetRemoved;
|
public event Action<BeatmapSetInfo> BeatmapSetRemoved;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
{
|
{
|
||||||
public Sprite Sprite;
|
public Sprite Sprite;
|
||||||
|
|
||||||
private string textureName;
|
private readonly string textureName;
|
||||||
|
|
||||||
public Background(string textureName = @"")
|
public Background(string textureName = @"")
|
||||||
{
|
{
|
||||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private Container content;
|
private readonly Container content;
|
||||||
private InputManager input;
|
private InputManager input;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
@ -31,10 +31,10 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
|
|
||||||
private float time;
|
private float time;
|
||||||
|
|
||||||
private TrailDrawNodeSharedData trailDrawNodeSharedData = new TrailDrawNodeSharedData();
|
private readonly TrailDrawNodeSharedData trailDrawNodeSharedData = new TrailDrawNodeSharedData();
|
||||||
private const int max_sprites = 2048;
|
private const int max_sprites = 2048;
|
||||||
|
|
||||||
private TrailPart[] parts = new TrailPart[max_sprites];
|
private readonly TrailPart[] parts = new TrailPart[max_sprites];
|
||||||
|
|
||||||
private Vector2? lastPosition;
|
private Vector2? lastPosition;
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
public float Time;
|
public float Time;
|
||||||
public TrailDrawNodeSharedData Shared;
|
public TrailDrawNodeSharedData Shared;
|
||||||
|
|
||||||
public TrailPart[] Parts = new TrailPart[max_sprites];
|
public readonly TrailPart[] Parts = new TrailPart[max_sprites];
|
||||||
public Vector2 Size;
|
public Vector2 Size;
|
||||||
|
|
||||||
public TrailDrawNode()
|
public TrailDrawNode()
|
||||||
|
@ -81,9 +81,14 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
public SampleChannel SampleClick, SampleHover;
|
public SampleChannel SampleClick, SampleHover;
|
||||||
|
|
||||||
private Container backgroundContainer, colourContainer, glowContainer;
|
private readonly Container backgroundContainer;
|
||||||
private Box leftGlow, centerGlow, rightGlow, background;
|
private readonly Container colourContainer;
|
||||||
private SpriteText spriteText;
|
private readonly Container glowContainer;
|
||||||
|
private readonly Box leftGlow;
|
||||||
|
private readonly Box centerGlow;
|
||||||
|
private readonly Box rightGlow;
|
||||||
|
private readonly Box background;
|
||||||
|
private readonly SpriteText spriteText;
|
||||||
private Vector2 hoverSpacing => new Vector2(3f, 0f);
|
private Vector2 hoverSpacing => new Vector2(3f, 0f);
|
||||||
|
|
||||||
private bool didClick; // Used for making sure that the OnMouseDown animation can call instead of OnHoverLost's when clicking
|
private bool didClick; // Used for making sure that the OnMouseDown animation can call instead of OnHoverLost's when clicking
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
public const float COLLAPSED_SIZE = 20;
|
public const float COLLAPSED_SIZE = 20;
|
||||||
public const float EXPANDED_SIZE = 40;
|
public const float EXPANDED_SIZE = 40;
|
||||||
|
|
||||||
private Box fill;
|
private readonly Box fill;
|
||||||
|
|
||||||
private const float border_width = 3;
|
private const float border_width = 3;
|
||||||
private Color4 glowingColour, idleColour;
|
private Color4 glowingColour, idleColour;
|
||||||
|
@ -64,8 +64,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Nub nub;
|
private readonly Nub nub;
|
||||||
private SpriteText labelSpriteText;
|
private readonly SpriteText labelSpriteText;
|
||||||
private SampleChannel sampleChecked;
|
private SampleChannel sampleChecked;
|
||||||
private SampleChannel sampleUnchecked;
|
private SampleChannel sampleUnchecked;
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
private Color4? accentColour;
|
private Color4? accentColour;
|
||||||
|
|
||||||
private TextAwesome chevron;
|
private readonly TextAwesome chevron;
|
||||||
|
|
||||||
protected override void FormatForeground(bool hover = false)
|
protected override void FormatForeground(bool hover = false)
|
||||||
{
|
{
|
||||||
@ -116,7 +116,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected class OsuDropdownHeader : DropdownHeader
|
protected class OsuDropdownHeader : DropdownHeader
|
||||||
{
|
{
|
||||||
private SpriteText label;
|
private readonly SpriteText label;
|
||||||
protected override string Label
|
protected override string Label
|
||||||
{
|
{
|
||||||
get { return label.Text; }
|
get { return label.Text; }
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
public class PasswordMaskChar : Container
|
public class PasswordMaskChar : Container
|
||||||
{
|
{
|
||||||
private CircularContainer circle;
|
private readonly CircularContainer circle;
|
||||||
|
|
||||||
public PasswordMaskChar(float size)
|
public PasswordMaskChar(float size)
|
||||||
{
|
{
|
||||||
|
@ -19,8 +19,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
private SampleChannel sample;
|
private SampleChannel sample;
|
||||||
private double lastSampleTime;
|
private double lastSampleTime;
|
||||||
|
|
||||||
private Nub nub;
|
private readonly Nub nub;
|
||||||
private Box leftBox, rightBox;
|
private readonly Box leftBox;
|
||||||
|
private readonly Box rightBox;
|
||||||
|
|
||||||
public OsuSliderBar()
|
public OsuSliderBar()
|
||||||
{
|
{
|
||||||
|
@ -59,8 +59,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
private class OsuTabItem : TabItem<T>
|
private class OsuTabItem : TabItem<T>
|
||||||
{
|
{
|
||||||
private SpriteText text;
|
private readonly SpriteText text;
|
||||||
private Box box;
|
private readonly Box box;
|
||||||
|
|
||||||
private Color4? accentColour;
|
private Color4? accentColour;
|
||||||
public Color4 AccentColour
|
public Color4 AccentColour
|
||||||
|
@ -147,7 +147,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
private class Star : Container
|
private class Star : Container
|
||||||
{
|
{
|
||||||
public TextAwesome Icon;
|
public readonly TextAwesome Icon;
|
||||||
public Star()
|
public Star()
|
||||||
{
|
{
|
||||||
Size = new Vector2(star_size);
|
Size = new Vector2(star_size);
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
public class TwoLayerButton : ClickableContainer
|
public class TwoLayerButton : ClickableContainer
|
||||||
{
|
{
|
||||||
private TextAwesome icon;
|
private readonly TextAwesome icon;
|
||||||
|
|
||||||
public Box IconLayer;
|
public Box IconLayer;
|
||||||
public Box TextLayer;
|
public Box TextLayer;
|
||||||
@ -29,11 +29,11 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
public static readonly Vector2 SIZE_EXTENDED = new Vector2(140, 50);
|
public static readonly Vector2 SIZE_EXTENDED = new Vector2(140, 50);
|
||||||
public static readonly Vector2 SIZE_RETRACTED = new Vector2(100, 50);
|
public static readonly Vector2 SIZE_RETRACTED = new Vector2(100, 50);
|
||||||
public SampleChannel ActivationSound;
|
public SampleChannel ActivationSound;
|
||||||
private SpriteText text;
|
private readonly SpriteText text;
|
||||||
|
|
||||||
public Color4 HoverColour;
|
public Color4 HoverColour;
|
||||||
private Container c1;
|
private readonly Container c1;
|
||||||
private Container c2;
|
private readonly Container c2;
|
||||||
|
|
||||||
public Color4 BackgroundColour
|
public Color4 BackgroundColour
|
||||||
{
|
{
|
||||||
|
@ -15,7 +15,7 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
{
|
{
|
||||||
internal class VolumeControl : OverlayContainer
|
internal class VolumeControl : OverlayContainer
|
||||||
{
|
{
|
||||||
private VolumeMeter volumeMeterMaster;
|
private readonly VolumeMeter volumeMeterMaster;
|
||||||
|
|
||||||
protected override bool HideOnEscape => false;
|
protected override bool HideOnEscape => false;
|
||||||
|
|
||||||
@ -89,8 +89,8 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
|
|
||||||
private ScheduledDelegate popOutDelegate;
|
private ScheduledDelegate popOutDelegate;
|
||||||
|
|
||||||
private VolumeMeter volumeMeterEffect;
|
private readonly VolumeMeter volumeMeterEffect;
|
||||||
private VolumeMeter volumeMeterMusic;
|
private readonly VolumeMeter volumeMeterMusic;
|
||||||
|
|
||||||
protected override void PopIn()
|
protected override void PopIn()
|
||||||
{
|
{
|
||||||
|
@ -15,7 +15,7 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
{
|
{
|
||||||
internal class VolumeMeter : Container
|
internal class VolumeMeter : Container
|
||||||
{
|
{
|
||||||
private Box meterFill;
|
private readonly Box meterFill;
|
||||||
public BindableDouble Bindable { get; } = new BindableDouble();
|
public BindableDouble Bindable { get; } = new BindableDouble();
|
||||||
|
|
||||||
public VolumeMeter(string meterName)
|
public VolumeMeter(string meterName)
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.IO.Legacy
|
|||||||
/// handle null strings and simplify use with ISerializable. </summary>
|
/// handle null strings and simplify use with ISerializable. </summary>
|
||||||
public class SerializationReader : BinaryReader
|
public class SerializationReader : BinaryReader
|
||||||
{
|
{
|
||||||
private Stream stream;
|
private readonly Stream stream;
|
||||||
|
|
||||||
public SerializationReader(Stream s)
|
public SerializationReader(Stream s)
|
||||||
: base(s, Encoding.UTF8)
|
: base(s, Encoding.UTF8)
|
||||||
|
@ -10,7 +10,7 @@ namespace osu.Game.IPC
|
|||||||
{
|
{
|
||||||
public class BeatmapIPCChannel : IpcChannel<BeatmapImportMessage>
|
public class BeatmapIPCChannel : IpcChannel<BeatmapImportMessage>
|
||||||
{
|
{
|
||||||
private BeatmapDatabase beatmaps;
|
private readonly BeatmapDatabase beatmaps;
|
||||||
|
|
||||||
public BeatmapIPCChannel(IIpcHost host, BeatmapDatabase beatmaps = null)
|
public BeatmapIPCChannel(IIpcHost host, BeatmapDatabase beatmaps = null)
|
||||||
: base(host)
|
: base(host)
|
||||||
|
@ -10,7 +10,7 @@ namespace osu.Game.IPC
|
|||||||
{
|
{
|
||||||
public class ScoreIPCChannel : IpcChannel<ScoreImportMessage>
|
public class ScoreIPCChannel : IpcChannel<ScoreImportMessage>
|
||||||
{
|
{
|
||||||
private ScoreDatabase scores;
|
private readonly ScoreDatabase scores;
|
||||||
|
|
||||||
public ScoreIPCChannel(IIpcHost host, ScoreDatabase scores = null)
|
public ScoreIPCChannel(IIpcHost host, ScoreDatabase scores = null)
|
||||||
: base(host)
|
: base(host)
|
||||||
|
@ -8,10 +8,10 @@ namespace osu.Game.Modes.Objects
|
|||||||
{
|
{
|
||||||
public class BezierApproximator
|
public class BezierApproximator
|
||||||
{
|
{
|
||||||
private int count;
|
private readonly int count;
|
||||||
private List<Vector2> controlPoints;
|
private readonly List<Vector2> controlPoints;
|
||||||
private Vector2[] subdivisionBuffer1;
|
private readonly Vector2[] subdivisionBuffer1;
|
||||||
private Vector2[] subdivisionBuffer2;
|
private readonly Vector2[] subdivisionBuffer2;
|
||||||
|
|
||||||
private const float tolerance = 0.25f;
|
private const float tolerance = 0.25f;
|
||||||
private const float tolerance_sq = tolerance * tolerance;
|
private const float tolerance_sq = tolerance * tolerance;
|
||||||
|
@ -10,9 +10,9 @@ namespace osu.Game.Modes.Objects
|
|||||||
{
|
{
|
||||||
public class CircularArcApproximator
|
public class CircularArcApproximator
|
||||||
{
|
{
|
||||||
private Vector2 a;
|
private readonly Vector2 a;
|
||||||
private Vector2 b;
|
private readonly Vector2 b;
|
||||||
private Vector2 c;
|
private readonly Vector2 c;
|
||||||
|
|
||||||
private int amountPoints;
|
private int amountPoints;
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@ namespace osu.Game.Modes.Objects
|
|||||||
|
|
||||||
public Vector2 Offset;
|
public Vector2 Offset;
|
||||||
|
|
||||||
private List<Vector2> calculatedPath = new List<Vector2>();
|
private readonly List<Vector2> calculatedPath = new List<Vector2>();
|
||||||
private List<double> cumulativeLength = new List<double>();
|
private readonly List<double> cumulativeLength = new List<double>();
|
||||||
|
|
||||||
private List<Vector2> calculateSubpath(List<Vector2> subControlPoints)
|
private List<Vector2> calculateSubpath(List<Vector2> subControlPoints)
|
||||||
{
|
{
|
||||||
|
@ -21,9 +21,9 @@ namespace osu.Game.Modes
|
|||||||
|
|
||||||
public abstract class Ruleset
|
public abstract class Ruleset
|
||||||
{
|
{
|
||||||
private static ConcurrentDictionary<PlayMode, Type> availableRulesets = new ConcurrentDictionary<PlayMode, Type>();
|
private static readonly ConcurrentDictionary<PlayMode, Type> available_rulesets = new ConcurrentDictionary<PlayMode, Type>();
|
||||||
|
|
||||||
public static IEnumerable<PlayMode> PlayModes => availableRulesets.Keys;
|
public static IEnumerable<PlayMode> PlayModes => available_rulesets.Keys;
|
||||||
|
|
||||||
public virtual IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { };
|
public virtual IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { };
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ namespace osu.Game.Modes
|
|||||||
|
|
||||||
public abstract ScoreProcessor CreateScoreProcessor();
|
public abstract ScoreProcessor CreateScoreProcessor();
|
||||||
|
|
||||||
public static void Register(Ruleset ruleset) => availableRulesets.TryAdd(ruleset.PlayMode, ruleset.GetType());
|
public static void Register(Ruleset ruleset) => available_rulesets.TryAdd(ruleset.PlayMode, ruleset.GetType());
|
||||||
|
|
||||||
protected abstract PlayMode PlayMode { get; }
|
protected abstract PlayMode PlayMode { get; }
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ namespace osu.Game.Modes
|
|||||||
{
|
{
|
||||||
Type type;
|
Type type;
|
||||||
|
|
||||||
if (!availableRulesets.TryGetValue(mode, out type))
|
if (!available_rulesets.TryGetValue(mode, out type))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return Activator.CreateInstance(type) as Ruleset;
|
return Activator.CreateInstance(type) as Ruleset;
|
||||||
|
@ -155,7 +155,7 @@ namespace osu.Game.Modes.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected Playfield<TObject, TJudgement> Playfield;
|
protected Playfield<TObject, TJudgement> Playfield;
|
||||||
|
|
||||||
private Container content;
|
private readonly Container content;
|
||||||
|
|
||||||
protected HitRenderer(WorkingBeatmap beatmap)
|
protected HitRenderer(WorkingBeatmap beatmap)
|
||||||
: base(beatmap)
|
: base(beatmap)
|
||||||
|
@ -10,7 +10,8 @@ namespace osu.Game.Modes.UI
|
|||||||
{
|
{
|
||||||
public class ModIcon : Container
|
public class ModIcon : Container
|
||||||
{
|
{
|
||||||
private TextAwesome modIcon, background;
|
private readonly TextAwesome modIcon;
|
||||||
|
private readonly TextAwesome background;
|
||||||
|
|
||||||
private float iconSize = 80;
|
private float iconSize = 80;
|
||||||
public float IconSize
|
public float IconSize
|
||||||
|
@ -23,7 +23,7 @@ namespace osu.Game.Modes.UI
|
|||||||
internal Container<Drawable> ScaledContent;
|
internal Container<Drawable> ScaledContent;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
private Container<Drawable> content;
|
private readonly Container<Drawable> content;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A container for keeping track of DrawableHitObjects.
|
/// A container for keeping track of DrawableHitObjects.
|
||||||
|
@ -15,7 +15,7 @@ namespace osu.Game.Modes.UI
|
|||||||
{
|
{
|
||||||
public class StandardHealthDisplay : HealthDisplay
|
public class StandardHealthDisplay : HealthDisplay
|
||||||
{
|
{
|
||||||
private Container fill;
|
private readonly Container fill;
|
||||||
|
|
||||||
public StandardHealthDisplay()
|
public StandardHealthDisplay()
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Online.API
|
|||||||
{
|
{
|
||||||
public class APIAccess : IUpdateable
|
public class APIAccess : IUpdateable
|
||||||
{
|
{
|
||||||
private OAuth authentication;
|
private readonly OAuth authentication;
|
||||||
|
|
||||||
public string Endpoint = @"https://new.ppy.sh";
|
public string Endpoint = @"https://new.ppy.sh";
|
||||||
private const string client_id = @"5";
|
private const string client_id = @"5";
|
||||||
@ -44,9 +44,9 @@ namespace osu.Game.Online.API
|
|||||||
protected bool HasLogin => Token != null || !string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password);
|
protected bool HasLogin => Token != null || !string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password);
|
||||||
|
|
||||||
// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable (should dispose of this or at very least keep a reference).
|
// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable (should dispose of this or at very least keep a reference).
|
||||||
private Thread thread;
|
private readonly Thread thread;
|
||||||
|
|
||||||
private Logger log;
|
private readonly Logger log;
|
||||||
|
|
||||||
public APIAccess()
|
public APIAccess()
|
||||||
{
|
{
|
||||||
@ -57,7 +57,7 @@ namespace osu.Game.Online.API
|
|||||||
thread.Start();
|
thread.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<IOnlineComponent> components = new List<IOnlineComponent>();
|
private readonly List<IOnlineComponent> components = new List<IOnlineComponent>();
|
||||||
|
|
||||||
public void Register(IOnlineComponent component)
|
public void Register(IOnlineComponent component)
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,7 @@ namespace osu.Game.Online.API.Requests
|
|||||||
{
|
{
|
||||||
public class GetMessagesRequest : APIRequest<List<Message>>
|
public class GetMessagesRequest : APIRequest<List<Message>>
|
||||||
{
|
{
|
||||||
private List<Channel> channels;
|
private readonly List<Channel> channels;
|
||||||
private long? since;
|
private long? since;
|
||||||
|
|
||||||
public GetMessagesRequest(List<Channel> channels, long? sinceId)
|
public GetMessagesRequest(List<Channel> channels, long? sinceId)
|
||||||
|
@ -14,8 +14,8 @@ namespace osu.Game.Online.Chat.Drawables
|
|||||||
public class DrawableChannel : Container
|
public class DrawableChannel : Container
|
||||||
{
|
{
|
||||||
private readonly Channel channel;
|
private readonly Channel channel;
|
||||||
private FillFlowContainer flow;
|
private readonly FillFlowContainer flow;
|
||||||
private ScrollContainer scroll;
|
private readonly ScrollContainer scroll;
|
||||||
|
|
||||||
public DrawableChannel(Channel channel)
|
public DrawableChannel(Channel channel)
|
||||||
{
|
{
|
||||||
|
@ -60,7 +60,7 @@ namespace osu.Game
|
|||||||
|
|
||||||
public Bindable<PlayMode> PlayMode;
|
public Bindable<PlayMode> PlayMode;
|
||||||
|
|
||||||
private string[] args;
|
private readonly string[] args;
|
||||||
|
|
||||||
private OptionsOverlay options;
|
private OptionsOverlay options;
|
||||||
|
|
||||||
|
@ -31,11 +31,11 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private ScheduledDelegate messageRequest;
|
private ScheduledDelegate messageRequest;
|
||||||
|
|
||||||
private Container content;
|
private readonly Container content;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
private FocusedTextBox inputTextBox;
|
private readonly FocusedTextBox inputTextBox;
|
||||||
|
|
||||||
private APIAccess api;
|
private APIAccess api;
|
||||||
|
|
||||||
|
@ -27,10 +27,12 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
private readonly Vector2 ringMinifiedSize = new Vector2(20f);
|
private readonly Vector2 ringMinifiedSize = new Vector2(20f);
|
||||||
private readonly Vector2 buttonsEnterSpacing = new Vector2(0f, 50f);
|
private readonly Vector2 buttonsEnterSpacing = new Vector2(0f, 50f);
|
||||||
|
|
||||||
private Container content, ring;
|
private readonly Container content;
|
||||||
private FillFlowContainer<PopupDialogButton> buttonsContainer;
|
private readonly Container ring;
|
||||||
private TextAwesome iconText;
|
private readonly FillFlowContainer<PopupDialogButton> buttonsContainer;
|
||||||
private SpriteText header, body;
|
private readonly TextAwesome iconText;
|
||||||
|
private readonly SpriteText header;
|
||||||
|
private readonly SpriteText body;
|
||||||
|
|
||||||
public FontAwesome Icon
|
public FontAwesome Icon
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
public class DialogOverlay : FocusedOverlayContainer
|
public class DialogOverlay : FocusedOverlayContainer
|
||||||
{
|
{
|
||||||
private Container dialogContainer;
|
private readonly Container dialogContainer;
|
||||||
private PopupDialog currentDialog;
|
private PopupDialog currentDialog;
|
||||||
|
|
||||||
public void Push(PopupDialog dialog)
|
public void Push(PopupDialog dialog)
|
||||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
public class DragBar : Container
|
public class DragBar : Container
|
||||||
{
|
{
|
||||||
private Box fill;
|
private readonly Box fill;
|
||||||
|
|
||||||
public Action<float> SeekRequested;
|
public Action<float> SeekRequested;
|
||||||
private bool isDragging;
|
private bool isDragging;
|
||||||
|
@ -23,8 +23,8 @@ namespace osu.Game.Overlays.Mods
|
|||||||
public class ModButton : FillFlowContainer
|
public class ModButton : FillFlowContainer
|
||||||
{
|
{
|
||||||
private ModIcon foregroundIcon { get; set; }
|
private ModIcon foregroundIcon { get; set; }
|
||||||
private SpriteText text;
|
private readonly SpriteText text;
|
||||||
private Container<ModIcon> iconsContainer;
|
private readonly Container<ModIcon> iconsContainer;
|
||||||
private SampleChannel sampleOn, sampleOff;
|
private SampleChannel sampleOn, sampleOff;
|
||||||
|
|
||||||
public Action<Mod> Action; // Passed the selected mod or null if none
|
public Action<Mod> Action; // Passed the selected mod or null if none
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
{
|
{
|
||||||
public abstract class ModSection : Container
|
public abstract class ModSection : Container
|
||||||
{
|
{
|
||||||
private OsuSpriteText headerLabel;
|
private readonly OsuSpriteText headerLabel;
|
||||||
|
|
||||||
public FillFlowContainer<ModButton> ButtonsContainer { get; }
|
public FillFlowContainer<ModButton> ButtonsContainer { get; }
|
||||||
|
|
||||||
|
@ -30,10 +30,11 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
private Color4 lowMultiplierColour, highMultiplierColour;
|
private Color4 lowMultiplierColour, highMultiplierColour;
|
||||||
|
|
||||||
private OsuSpriteText rankedLabel, multiplierLabel;
|
private readonly OsuSpriteText rankedLabel;
|
||||||
private FillFlowContainer rankedMultiplerContainer;
|
private readonly OsuSpriteText multiplierLabel;
|
||||||
|
private readonly FillFlowContainer rankedMultiplerContainer;
|
||||||
|
|
||||||
private FillFlowContainer<ModSection> modSectionsContainer;
|
private readonly FillFlowContainer<ModSection> modSectionsContainer;
|
||||||
|
|
||||||
public readonly Bindable<IEnumerable<Mod>> SelectedMods = new Bindable<IEnumerable<Mod>>();
|
public readonly Bindable<IEnumerable<Mod>> SelectedMods = new Bindable<IEnumerable<Mod>>();
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Overlays
|
|||||||
private SpriteText title, artist;
|
private SpriteText title, artist;
|
||||||
|
|
||||||
private List<BeatmapSetInfo> playList;
|
private List<BeatmapSetInfo> playList;
|
||||||
private List<BeatmapInfo> playHistory = new List<BeatmapInfo>();
|
private readonly List<BeatmapInfo> playHistory = new List<BeatmapInfo>();
|
||||||
private int playListIndex;
|
private int playListIndex;
|
||||||
private int playHistoryIndex = -1;
|
private int playHistoryIndex = -1;
|
||||||
|
|
||||||
@ -415,8 +415,8 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private class MusicControllerBackground : BufferedContainer
|
private class MusicControllerBackground : BufferedContainer
|
||||||
{
|
{
|
||||||
private Sprite sprite;
|
private readonly Sprite sprite;
|
||||||
private WorkingBeatmap beatmap;
|
private readonly WorkingBeatmap beatmap;
|
||||||
|
|
||||||
public MusicControllerBackground(WorkingBeatmap beatmap = null)
|
public MusicControllerBackground(WorkingBeatmap beatmap = null)
|
||||||
{
|
{
|
||||||
|
@ -35,9 +35,9 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
public virtual bool DisplayOnTop => true;
|
public virtual bool DisplayOnTop => true;
|
||||||
|
|
||||||
protected NotificationLight Light;
|
protected NotificationLight Light;
|
||||||
private CloseButton closeButton;
|
private readonly CloseButton closeButton;
|
||||||
protected Container IconContent;
|
protected Container IconContent;
|
||||||
private Container content;
|
private readonly Container content;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
private class ClearAllButton : ClickableContainer
|
private class ClearAllButton : ClickableContainer
|
||||||
{
|
{
|
||||||
private OsuSpriteText text;
|
private readonly OsuSpriteText text;
|
||||||
|
|
||||||
public ClearAllButton()
|
public ClearAllButton()
|
||||||
{
|
{
|
||||||
|
@ -104,12 +104,12 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
public override bool DisplayOnTop => false;
|
public override bool DisplayOnTop => false;
|
||||||
|
|
||||||
private ProgressBar progressBar;
|
private readonly ProgressBar progressBar;
|
||||||
private Color4 colourQueued;
|
private Color4 colourQueued;
|
||||||
private Color4 colourActive;
|
private Color4 colourActive;
|
||||||
private Color4 colourCancelled;
|
private Color4 colourCancelled;
|
||||||
|
|
||||||
private SpriteText textDrawable;
|
private readonly SpriteText textDrawable;
|
||||||
|
|
||||||
public ProgressNotification()
|
public ProgressNotification()
|
||||||
{
|
{
|
||||||
|
@ -34,8 +34,8 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private SpriteText textDrawable;
|
private readonly SpriteText textDrawable;
|
||||||
private TextAwesome iconDrawable;
|
private readonly TextAwesome iconDrawable;
|
||||||
|
|
||||||
protected Box IconBackgound;
|
protected Box IconBackgound;
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ namespace osu.Game.Overlays.Options
|
|||||||
{
|
{
|
||||||
public class OptionDropdown<T> : FillFlowContainer
|
public class OptionDropdown<T> : FillFlowContainer
|
||||||
{
|
{
|
||||||
private Dropdown<T> dropdown;
|
private readonly Dropdown<T> dropdown;
|
||||||
private SpriteText text;
|
private readonly SpriteText text;
|
||||||
|
|
||||||
public string LabelText
|
public string LabelText
|
||||||
{
|
{
|
||||||
|
@ -14,8 +14,8 @@ namespace osu.Game.Overlays.Options
|
|||||||
{
|
{
|
||||||
public class OptionSlider<T> : FillFlowContainer where T : struct
|
public class OptionSlider<T> : FillFlowContainer where T : struct
|
||||||
{
|
{
|
||||||
private SliderBar<T> slider;
|
private readonly SliderBar<T> slider;
|
||||||
private SpriteText text;
|
private readonly SpriteText text;
|
||||||
|
|
||||||
public string LabelText
|
public string LabelText
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Options
|
|||||||
public abstract FontAwesome Icon { get; }
|
public abstract FontAwesome Icon { get; }
|
||||||
public abstract string Header { get; }
|
public abstract string Header { get; }
|
||||||
|
|
||||||
private SpriteText headerLabel;
|
private readonly SpriteText headerLabel;
|
||||||
|
|
||||||
protected OptionsSection()
|
protected OptionsSection()
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Overlays.Options
|
|||||||
{
|
{
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
private Container<Drawable> content;
|
private readonly Container<Drawable> content;
|
||||||
|
|
||||||
protected abstract string Header { get; }
|
protected abstract string Header { get; }
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Options
|
|||||||
{
|
{
|
||||||
public class Sidebar : Container
|
public class Sidebar : Container
|
||||||
{
|
{
|
||||||
private FillFlowContainer content;
|
private readonly FillFlowContainer content;
|
||||||
internal const float DEFAULT_WIDTH = ToolbarButton.WIDTH;
|
internal const float DEFAULT_WIDTH = ToolbarButton.WIDTH;
|
||||||
internal const int EXPANDED_WIDTH = 200;
|
internal const int EXPANDED_WIDTH = 200;
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
@ -16,11 +16,11 @@ namespace osu.Game.Overlays.Options
|
|||||||
{
|
{
|
||||||
public class SidebarButton : Container
|
public class SidebarButton : Container
|
||||||
{
|
{
|
||||||
private TextAwesome drawableIcon;
|
private readonly TextAwesome drawableIcon;
|
||||||
private SpriteText headerText;
|
private readonly SpriteText headerText;
|
||||||
private Box backgroundBox;
|
private readonly Box backgroundBox;
|
||||||
private Box selectionIndicator;
|
private readonly Box selectionIndicator;
|
||||||
private Container text;
|
private readonly Container text;
|
||||||
public Action Action;
|
public Action Action;
|
||||||
|
|
||||||
private OptionsSection section;
|
private OptionsSection section;
|
||||||
|
@ -23,8 +23,8 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
public Action OnHome;
|
public Action OnHome;
|
||||||
public Action<PlayMode> OnPlayModeChange;
|
public Action<PlayMode> OnPlayModeChange;
|
||||||
|
|
||||||
private ToolbarModeSelector modeSelector;
|
private readonly ToolbarModeSelector modeSelector;
|
||||||
private ToolbarUserArea userArea;
|
private readonly ToolbarUserArea userArea;
|
||||||
|
|
||||||
protected override bool HideOnEscape => false;
|
protected override bool HideOnEscape => false;
|
||||||
|
|
||||||
@ -90,8 +90,8 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
|
|
||||||
public class ToolbarBackground : Container
|
public class ToolbarBackground : Container
|
||||||
{
|
{
|
||||||
private Box solidBackground;
|
private readonly Box solidBackground;
|
||||||
private Box gradientBackground;
|
private readonly Box gradientBackground;
|
||||||
|
|
||||||
public ToolbarBackground()
|
public ToolbarBackground()
|
||||||
{
|
{
|
||||||
|
@ -63,9 +63,9 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
protected TextAwesome DrawableIcon;
|
protected TextAwesome DrawableIcon;
|
||||||
protected SpriteText DrawableText;
|
protected SpriteText DrawableText;
|
||||||
protected Box HoverBackground;
|
protected Box HoverBackground;
|
||||||
private FillFlowContainer tooltipContainer;
|
private readonly FillFlowContainer tooltipContainer;
|
||||||
private SpriteText tooltip1;
|
private readonly SpriteText tooltip1;
|
||||||
private SpriteText tooltip2;
|
private readonly SpriteText tooltip2;
|
||||||
protected FillFlowContainer Flow;
|
protected FillFlowContainer Flow;
|
||||||
private SampleChannel sampleClick;
|
private SampleChannel sampleClick;
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
{
|
{
|
||||||
private const float padding = 10;
|
private const float padding = 10;
|
||||||
|
|
||||||
private FillFlowContainer modeButtons;
|
private readonly FillFlowContainer modeButtons;
|
||||||
private Drawable modeButtonLine;
|
private readonly Drawable modeButtonLine;
|
||||||
private ToolbarModeButton activeButton;
|
private ToolbarModeButton activeButton;
|
||||||
|
|
||||||
public Action<PlayMode> OnPlayModeChange;
|
public Action<PlayMode> OnPlayModeChange;
|
||||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
{
|
{
|
||||||
internal class ToolbarOverlayToggleButton : ToolbarButton
|
internal class ToolbarOverlayToggleButton : ToolbarButton
|
||||||
{
|
{
|
||||||
private Box stateBackground;
|
private readonly Box stateBackground;
|
||||||
|
|
||||||
private OverlayContainer stateContainer;
|
private OverlayContainer stateContainer;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
internal class ToolbarUserArea : Container
|
internal class ToolbarUserArea : Container
|
||||||
{
|
{
|
||||||
public LoginOverlay LoginOverlay;
|
public LoginOverlay LoginOverlay;
|
||||||
private ToolbarUserButton button;
|
private readonly ToolbarUserButton button;
|
||||||
|
|
||||||
public override RectangleF BoundingBox => button.BoundingBox;
|
public override RectangleF BoundingBox => button.BoundingBox;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
{
|
{
|
||||||
internal class ToolbarUserButton : ToolbarButton, IOnlineComponent
|
internal class ToolbarUserButton : ToolbarButton, IOnlineComponent
|
||||||
{
|
{
|
||||||
private Avatar avatar;
|
private readonly Avatar avatar;
|
||||||
|
|
||||||
public ToolbarUserButton()
|
public ToolbarUserButton()
|
||||||
{
|
{
|
||||||
|
@ -20,9 +20,12 @@ namespace osu.Game.Overlays
|
|||||||
private const EasingTypes easing_show = EasingTypes.OutSine;
|
private const EasingTypes easing_show = EasingTypes.OutSine;
|
||||||
private const EasingTypes easing_hide = EasingTypes.InSine;
|
private const EasingTypes easing_hide = EasingTypes.InSine;
|
||||||
|
|
||||||
private Wave firstWave, secondWave, thirdWave, fourthWave;
|
private readonly Wave firstWave;
|
||||||
|
private readonly Wave secondWave;
|
||||||
|
private readonly Wave thirdWave;
|
||||||
|
private readonly Wave fourthWave;
|
||||||
|
|
||||||
private Container<Wave> wavesContainer;
|
private readonly Container<Wave> wavesContainer;
|
||||||
|
|
||||||
private readonly Container contentContainer;
|
private readonly Container contentContainer;
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
|
|
||||||
private class BeatmapBackground : Background
|
private class BeatmapBackground : Background
|
||||||
{
|
{
|
||||||
private WorkingBeatmap beatmap;
|
private readonly WorkingBeatmap beatmap;
|
||||||
|
|
||||||
public BeatmapBackground(WorkingBeatmap beatmap)
|
public BeatmapBackground(WorkingBeatmap beatmap)
|
||||||
{
|
{
|
||||||
|
@ -19,14 +19,14 @@ namespace osu.Game.Screens
|
|||||||
{
|
{
|
||||||
public class ScreenWhiteBox : OsuScreen
|
public class ScreenWhiteBox : OsuScreen
|
||||||
{
|
{
|
||||||
private BackButton popButton;
|
private readonly BackButton popButton;
|
||||||
|
|
||||||
private const double transition_time = 1000;
|
private const double transition_time = 1000;
|
||||||
|
|
||||||
protected virtual IEnumerable<Type> PossibleChildren => null;
|
protected virtual IEnumerable<Type> PossibleChildren => null;
|
||||||
|
|
||||||
private Container textContainer;
|
private readonly Container textContainer;
|
||||||
private Box box;
|
private readonly Box box;
|
||||||
|
|
||||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg2");
|
protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg2");
|
||||||
|
|
||||||
|
@ -26,13 +26,13 @@ namespace osu.Game.Screens.Menu
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class Button : Container, IStateful<ButtonState>
|
public class Button : Container, IStateful<ButtonState>
|
||||||
{
|
{
|
||||||
private Container iconText;
|
private readonly Container iconText;
|
||||||
private Container box;
|
private readonly Container box;
|
||||||
private Box boxHoverLayer;
|
private readonly Box boxHoverLayer;
|
||||||
private TextAwesome icon;
|
private readonly TextAwesome icon;
|
||||||
private string internalName;
|
private readonly string internalName;
|
||||||
private Action clickAction;
|
private readonly Action clickAction;
|
||||||
private Key triggerKey;
|
private readonly Key triggerKey;
|
||||||
private SampleChannel sampleClick;
|
private SampleChannel sampleClick;
|
||||||
|
|
||||||
protected override bool InternalContains(Vector2 screenSpacePos) => box.Contains(screenSpacePos);
|
protected override bool InternalContains(Vector2 screenSpacePos) => box.Contains(screenSpacePos);
|
||||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
private Toolbar toolbar;
|
private Toolbar toolbar;
|
||||||
|
|
||||||
private FlowContainerWithOrigin buttonFlow;
|
private readonly FlowContainerWithOrigin buttonFlow;
|
||||||
|
|
||||||
//todo: make these non-internal somehow.
|
//todo: make these non-internal somehow.
|
||||||
internal const float BUTTON_AREA_HEIGHT = 100;
|
internal const float BUTTON_AREA_HEIGHT = 100;
|
||||||
@ -41,16 +41,16 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
public const int EXIT_DELAY = 3000;
|
public const int EXIT_DELAY = 3000;
|
||||||
|
|
||||||
private OsuLogo osuLogo;
|
private readonly OsuLogo osuLogo;
|
||||||
private Drawable iconFacade;
|
private readonly Drawable iconFacade;
|
||||||
private Container buttonArea;
|
private readonly Container buttonArea;
|
||||||
private Box buttonAreaBackground;
|
private readonly Box buttonAreaBackground;
|
||||||
|
|
||||||
private Button backButton;
|
private readonly Button backButton;
|
||||||
private Button settingsButton;
|
private readonly Button settingsButton;
|
||||||
|
|
||||||
private List<Button> buttonsTopLevel = new List<Button>();
|
private readonly List<Button> buttonsTopLevel = new List<Button>();
|
||||||
private List<Button> buttonsPlay = new List<Button>();
|
private readonly List<Button> buttonsPlay = new List<Button>();
|
||||||
|
|
||||||
public ButtonSystem()
|
public ButtonSystem()
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
internal class Disclaimer : OsuScreen
|
internal class Disclaimer : OsuScreen
|
||||||
{
|
{
|
||||||
private Intro intro;
|
private Intro intro;
|
||||||
private TextAwesome icon;
|
private readonly TextAwesome icon;
|
||||||
private Color4 iconColour;
|
private Color4 iconColour;
|
||||||
|
|
||||||
internal override bool ShowOverlays => false;
|
internal override bool ShowOverlays => false;
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
{
|
{
|
||||||
public class Intro : OsuScreen
|
public class Intro : OsuScreen
|
||||||
{
|
{
|
||||||
private OsuLogo logo;
|
private readonly OsuLogo logo;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether we have loaded the menu previously.
|
/// Whether we have loaded the menu previously.
|
||||||
|
@ -22,11 +22,11 @@ namespace osu.Game.Screens.Menu
|
|||||||
{
|
{
|
||||||
public class MainMenu : OsuScreen
|
public class MainMenu : OsuScreen
|
||||||
{
|
{
|
||||||
private ButtonSystem buttons;
|
private readonly ButtonSystem buttons;
|
||||||
|
|
||||||
internal override bool ShowOverlays => buttons.State != MenuState.Initial;
|
internal override bool ShowOverlays => buttons.State != MenuState.Initial;
|
||||||
|
|
||||||
private BackgroundScreen background;
|
private readonly BackgroundScreen background;
|
||||||
private Screen songSelect;
|
private Screen songSelect;
|
||||||
|
|
||||||
protected override BackgroundScreen CreateBackground() => background;
|
protected override BackgroundScreen CreateBackground() => background;
|
||||||
|
@ -25,22 +25,22 @@ namespace osu.Game.Screens.Menu
|
|||||||
{
|
{
|
||||||
public Color4 OsuPink = OsuColour.FromHex(@"e967a1");
|
public Color4 OsuPink = OsuColour.FromHex(@"e967a1");
|
||||||
|
|
||||||
private Sprite logo;
|
private readonly Sprite logo;
|
||||||
private CircularContainer logoContainer;
|
private readonly CircularContainer logoContainer;
|
||||||
private Container logoBounceContainer;
|
private readonly Container logoBounceContainer;
|
||||||
private Container logoHoverContainer;
|
private readonly Container logoHoverContainer;
|
||||||
|
|
||||||
private SampleChannel sampleClick;
|
private SampleChannel sampleClick;
|
||||||
|
|
||||||
private Container colourAndTriangles;
|
private readonly Container colourAndTriangles;
|
||||||
|
|
||||||
public Action Action;
|
public Action Action;
|
||||||
|
|
||||||
public float SizeForFlow => logo == null ? 0 : logo.DrawSize.X * logo.Scale.X * logoBounceContainer.Scale.X * logoHoverContainer.Scale.X * 0.78f;
|
public float SizeForFlow => logo == null ? 0 : logo.DrawSize.X * logo.Scale.X * logoBounceContainer.Scale.X * logoHoverContainer.Scale.X * 0.78f;
|
||||||
|
|
||||||
private Sprite ripple;
|
private readonly Sprite ripple;
|
||||||
|
|
||||||
private Container rippleContainer;
|
private readonly Container rippleContainer;
|
||||||
|
|
||||||
public bool Triangles
|
public bool Triangles
|
||||||
{
|
{
|
||||||
@ -62,7 +62,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
}
|
}
|
||||||
|
|
||||||
public bool Interactive = true;
|
public bool Interactive = true;
|
||||||
private Box flashLayer;
|
private readonly Box flashLayer;
|
||||||
|
|
||||||
public OsuLogo()
|
public OsuLogo()
|
||||||
{
|
{
|
||||||
|
@ -106,7 +106,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
public class Receptor : Drawable
|
public class Receptor : Drawable
|
||||||
{
|
{
|
||||||
private KeyCounterCollection target;
|
private readonly KeyCounterCollection target;
|
||||||
|
|
||||||
public Receptor(KeyCounterCollection target)
|
public Receptor(KeyCounterCollection target)
|
||||||
{
|
{
|
||||||
|
@ -13,10 +13,10 @@ namespace osu.Game.Screens.Play.Pause
|
|||||||
{
|
{
|
||||||
public class PauseProgressBar : Container
|
public class PauseProgressBar : Container
|
||||||
{
|
{
|
||||||
private Color4 fillColour = new Color4(221, 255, 255, 255);
|
private readonly Color4 fillColour = new Color4(221, 255, 255, 255);
|
||||||
private Color4 glowColour = new Color4(221, 255, 255, 150);
|
private readonly Color4 glowColour = new Color4(221, 255, 255, 150);
|
||||||
|
|
||||||
private Container fill;
|
private readonly Container fill;
|
||||||
private WorkingBeatmap current;
|
private WorkingBeatmap current;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
public int RestartCount;
|
public int RestartCount;
|
||||||
|
|
||||||
private double pauseCooldown = 1000;
|
private readonly double pauseCooldown = 1000;
|
||||||
private double lastPauseActionTime;
|
private double lastPauseActionTime;
|
||||||
|
|
||||||
private bool canPause => Time.Current >= lastPauseActionTime + pauseCooldown;
|
private bool canPause => Time.Current >= lastPauseActionTime + pauseCooldown;
|
||||||
|
@ -9,7 +9,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
public class PlayerInputManager : PassThroughInputManager
|
public class PlayerInputManager : PassThroughInputManager
|
||||||
{
|
{
|
||||||
private ManualClock clock = new ManualClock();
|
private readonly ManualClock clock = new ManualClock();
|
||||||
private IFrameBasedClock parentClock;
|
private IFrameBasedClock parentClock;
|
||||||
|
|
||||||
private ReplayInputHandler replayInputHandler;
|
private ReplayInputHandler replayInputHandler;
|
||||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Screens.Play
|
|||||||
public class PlayerLoader : OsuScreen
|
public class PlayerLoader : OsuScreen
|
||||||
{
|
{
|
||||||
private readonly Player player;
|
private readonly Player player;
|
||||||
private OsuLogo logo;
|
private readonly OsuLogo logo;
|
||||||
private BeatmapMetadataDisplay info;
|
private BeatmapMetadataDisplay info;
|
||||||
|
|
||||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
|
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
|
||||||
|
@ -60,18 +60,18 @@ namespace osu.Game.Screens.Select
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<float> yPositions = new List<float>();
|
private readonly List<float> yPositions = new List<float>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required for now unfortunately.
|
/// Required for now unfortunately.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private BeatmapDatabase database;
|
private BeatmapDatabase database;
|
||||||
|
|
||||||
private Container<Panel> scrollableContent;
|
private readonly Container<Panel> scrollableContent;
|
||||||
|
|
||||||
private List<BeatmapGroup> groups = new List<BeatmapGroup>();
|
private readonly List<BeatmapGroup> groups = new List<BeatmapGroup>();
|
||||||
|
|
||||||
private List<Panel> panels = new List<Panel>();
|
private readonly List<Panel> panels = new List<Panel>();
|
||||||
|
|
||||||
private BeatmapGroup selectedGroup;
|
private BeatmapGroup selectedGroup;
|
||||||
|
|
||||||
|
@ -24,9 +24,9 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
public Action<FilterCriteria> FilterChanged;
|
public Action<FilterCriteria> FilterChanged;
|
||||||
|
|
||||||
private OsuTabControl<SortMode> sortTabs;
|
private readonly OsuTabControl<SortMode> sortTabs;
|
||||||
|
|
||||||
private TabControl<GroupMode> groupTabs;
|
private readonly TabControl<GroupMode> groupTabs;
|
||||||
|
|
||||||
private SortMode sort = SortMode.Title;
|
private SortMode sort = SortMode.Title;
|
||||||
public SortMode Sort
|
public SortMode Sort
|
||||||
@ -66,7 +66,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
public Action Exit;
|
public Action Exit;
|
||||||
|
|
||||||
private SearchTextBox searchTextBox;
|
private readonly SearchTextBox searchTextBox;
|
||||||
|
|
||||||
protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || groupTabs.Contains(screenSpacePos) || sortTabs.Contains(screenSpacePos);
|
protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || groupTabs.Contains(screenSpacePos) || sortTabs.Contains(screenSpacePos);
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
public class Footer : Container
|
public class Footer : Container
|
||||||
{
|
{
|
||||||
private Box modeLight;
|
private readonly Box modeLight;
|
||||||
|
|
||||||
private const float play_song_select_button_width = 100;
|
private const float play_song_select_button_width = 100;
|
||||||
private const float play_song_select_button_height = 50;
|
private const float play_song_select_button_height = 50;
|
||||||
@ -29,7 +29,7 @@ namespace osu.Game.Screens.Select
|
|||||||
public Action OnBack;
|
public Action OnBack;
|
||||||
public Action OnStart;
|
public Action OnStart;
|
||||||
|
|
||||||
private FillFlowContainer buttons;
|
private readonly FillFlowContainer buttons;
|
||||||
|
|
||||||
public OsuLogo StartButton;
|
public OsuLogo StartButton;
|
||||||
|
|
||||||
|
@ -51,9 +51,9 @@ namespace osu.Game.Screens.Select
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private SpriteText spriteText;
|
private readonly SpriteText spriteText;
|
||||||
private Box box;
|
private readonly Box box;
|
||||||
private Box light;
|
private readonly Box light;
|
||||||
|
|
||||||
public FooterButton()
|
public FooterButton()
|
||||||
{
|
{
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user