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

Clean Up Code

This commit is contained in:
John Neijzen 2017-06-07 19:53:37 +08:00
parent f52f8326dd
commit 9b0e1c26a3
9 changed files with 39 additions and 33 deletions

View File

@ -448,7 +448,6 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
return curveData.RepeatSamples[index];
}
/// <summary>
/// Constructs and adds a note to a pattern.
/// </summary>
@ -480,7 +479,6 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
Tail = { Samples = sampleInfoListAt(endTime) }
};
newObject = holdNote;
}

View File

@ -136,7 +136,7 @@ namespace osu.Game.Graphics.Cursor
for (float d = interval; d < distance; d += interval)
{
lastPosition = pos1 + direction * d;
lastPosition = pos1 + (direction * d);
addPosition(lastPosition.Value);
}
}
@ -213,7 +213,7 @@ namespace osu.Game.Graphics.Cursor
colour.BottomRight.Linear.A = Parts[i].Time + colour.BottomRight.Linear.A;
Texture.DrawQuad(
new Quad(pos.X - Size.X / 2, pos.Y - Size.Y / 2, Size.X, Size.Y),
new Quad(pos.X - (Size.X / 2), pos.Y - (Size.Y / 2), Size.X, Size.Y),
colour,
null,
v => Shared.VertexBuffer.Vertices[end++] = v);

View File

@ -148,7 +148,7 @@ namespace osu.Game
RelativeSizeAxes = Axes.Both,
},
volume = new VolumeControl(),
overlayContent = new Container{ RelativeSizeAxes = Axes.Both },
overlayContent = new Container { RelativeSizeAxes = Axes.Both },
new OnScreenDisplay(),
new GlobalHotkeys //exists because UserInputManager is at a level below us.
{

View File

@ -66,7 +66,7 @@ namespace osu.Game.Screens.Menu
Scale = new Vector2(0, 1),
Size = boxSize,
Shear = new Vector2(ButtonSystem.WEDGE_WIDTH / boxSize.Y, 0),
Children = new []
Children = new[]
{
new Box
{
@ -143,7 +143,7 @@ namespace osu.Game.Screens.Menu
StartValue = -10,
EndValue = 10,
StartTime = startTime,
EndTime = startTime + duration * 2,
EndTime = startTime + (duration * 2),
Easing = EasingTypes.InOutSine,
LoopCount = -1,
LoopDelay = duration * 2
@ -176,7 +176,7 @@ namespace osu.Game.Screens.Menu
StartValue = new Vector2(0, -10),
EndValue = Vector2.Zero,
StartTime = startTime + duration,
EndTime = startTime + duration * 2,
EndTime = startTime + (duration * 2),
Easing = EasingTypes.In,
LoopCount = -1,
LoopDelay = duration
@ -187,7 +187,7 @@ namespace osu.Game.Screens.Menu
StartValue = Vector2.One,
EndValue = new Vector2(1, 0.9f),
StartTime = startTime + duration,
EndTime = startTime + duration * 2,
EndTime = startTime + (duration * 2),
Easing = EasingTypes.In,
LoopCount = -1,
LoopDelay = duration
@ -197,8 +197,8 @@ namespace osu.Game.Screens.Menu
{
StartValue = 10,
EndValue = -10,
StartTime = startTime + duration * 2,
EndTime = startTime + duration * 4,
StartTime = startTime + (duration * 2),
EndTime = startTime + (duration * 4),
Easing = EasingTypes.InOutSine,
LoopCount = -1,
LoopDelay = duration * 2
@ -282,10 +282,13 @@ namespace osu.Game.Screens.Menu
public ButtonState State
{
get { return state; }
get
{
return state;
}
set
{
if (state == value)
return;

View File

@ -51,10 +51,7 @@ namespace osu.Game.Screens.Menu
public bool Triangles
{
set
{
colourAndTriangles.Alpha = value ? 1 : 0;
}
set { colourAndTriangles.Alpha = value ? 1 : 0; }
}
protected override bool InternalContains(Vector2 screenSpacePos) => logoContainer.Contains(screenSpacePos);
@ -62,10 +59,7 @@ namespace osu.Game.Screens.Menu
public bool Ripple
{
get { return rippleContainer.Alpha > 0; }
set
{
rippleContainer.Alpha = value ? 1 : 0;
}
set { rippleContainer.Alpha = value ? 1 : 0; }
}
public bool Interactive = true;
@ -237,7 +231,7 @@ namespace osu.Game.Screens.Menu
if (beatIndex < 0) return;
logoBeatContainer.ScaleTo(1 - 0.02f * amplitudeAdjust, beat_in_time, EasingTypes.Out);
logoBeatContainer.ScaleTo(1 - (0.02f * amplitudeAdjust), beat_in_time, EasingTypes.Out);
using (logoBeatContainer.BeginDelayedSequence(beat_in_time))
logoBeatContainer.ScaleTo(1, beatLength * 2, EasingTypes.OutQuint);
@ -246,7 +240,7 @@ namespace osu.Game.Screens.Menu
ripple.ScaleTo(logoAmplitudeContainer.Scale);
ripple.Alpha = 0.15f * amplitudeAdjust;
ripple.ScaleTo(logoAmplitudeContainer.Scale * (1 + 0.04f * amplitudeAdjust), beatLength, EasingTypes.OutQuint);
ripple.ScaleTo(logoAmplitudeContainer.Scale * (1 + (0.04f * amplitudeAdjust)), beatLength, EasingTypes.OutQuint);
ripple.FadeOut(beatLength, EasingTypes.OutQuint);
if (effectPoint.KiaiMode && flashLayer.Alpha < 0.4f)

View File

@ -278,7 +278,6 @@ namespace osu.Game.Screens.Play
{
if (!pauseContainer.IsPaused)
decoupledClock.Start();
});
pauseContainer.Alpha = 0;

View File

@ -244,7 +244,7 @@ namespace osu.Game.Screens.Select
private BeatmapGroup createGroup(BeatmapSetInfo beatmapSet)
{
foreach(var b in beatmapSet.Beatmaps)
foreach (var b in beatmapSet.Beatmaps)
{
if (b.Metadata == null)
b.Metadata = beatmapSet.Metadata;

View File

@ -46,7 +46,11 @@ namespace osu.Game.Screens.Select
public BeatmapInfo Beatmap
{
get { return beatmap; }
get
{
return beatmap;
}
set
{
if (beatmap == value) return;
@ -165,7 +169,7 @@ namespace osu.Game.Screens.Select
Direction = FillDirection.Vertical,
LayoutDuration = 200,
LayoutEasing = EasingTypes.OutQuint,
Children = new []
Children = new[]
{
description = new MetadataSegment("Description"),
source = new MetadataSegment("Source"),
@ -199,9 +203,9 @@ namespace osu.Game.Screens.Select
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0,5),
Spacing = new Vector2(0, 5),
Padding = new MarginPadding(10),
Children = new []
Children = new[]
{
circleSize = new DifficultyRow("Circle Size", 7),
drainRate = new DifficultyRow("HP Drain"),
@ -479,7 +483,7 @@ namespace osu.Game.Screens.Select
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Full,
Spacing = new Vector2(5,0),
Spacing = new Vector2(5, 0),
Margin = new MarginPadding { Top = header.TextSize }
}
};

View File

@ -82,7 +82,11 @@ namespace osu.Game.Screens.Tournament
private ScrollState _scrollState;
private ScrollState scrollState
{
get { return _scrollState; }
get
{
return _scrollState;
}
set
{
if (_scrollState == value)
@ -261,7 +265,7 @@ namespace osu.Game.Screens.Tournament
else
{
c.MoveToX(pos, 100);
c.FadeTo(1.0f - Math.Abs(pos - DrawWidth / 2f) / (DrawWidth / 2.5f), 100);
c.FadeTo(1.0f - (Math.Abs(pos - (DrawWidth / 2f)) / (DrawWidth / 2.5f)), 100);
}
pos += ScrollingTeam.WIDTH;
@ -328,7 +332,11 @@ namespace osu.Game.Screens.Tournament
private bool selected;
public bool Selected
{
get { return selected; }
get
{
return selected;
}
set
{
selected = value;