From 9b0e1c26a3996d0c4abb823c9410445ff27904a2 Mon Sep 17 00:00:00 2001 From: John Neijzen Date: Wed, 7 Jun 2017 19:53:37 +0800 Subject: [PATCH 1/4] Clean Up Code --- .../Legacy/DistanceObjectPatternGenerator.cs | 2 -- osu.Game/Graphics/Cursor/CursorTrail.cs | 4 ++-- osu.Game/OsuGame.cs | 2 +- osu.Game/Screens/Menu/Button.cs | 19 +++++++++++-------- osu.Game/Screens/Menu/OsuLogo.cs | 14 ++++---------- osu.Game/Screens/Play/Player.cs | 1 - osu.Game/Screens/Select/BeatmapCarousel.cs | 2 +- osu.Game/Screens/Select/BeatmapDetails.cs | 14 +++++++++----- .../Tournament/ScrollingTeamContainer.cs | 14 +++++++++++--- 9 files changed, 39 insertions(+), 33 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs index 2d1f75e196..7e9615a703 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs @@ -448,7 +448,6 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy return curveData.RepeatSamples[index]; } - /// /// Constructs and adds a note to a pattern. /// @@ -480,7 +479,6 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy Tail = { Samples = sampleInfoListAt(endTime) } }; - newObject = holdNote; } diff --git a/osu.Game/Graphics/Cursor/CursorTrail.cs b/osu.Game/Graphics/Cursor/CursorTrail.cs index 11475a0f19..754390047f 100644 --- a/osu.Game/Graphics/Cursor/CursorTrail.cs +++ b/osu.Game/Graphics/Cursor/CursorTrail.cs @@ -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); diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 2c952ee514..a8bee97eb4 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -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. { diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index fe9f7b4bf6..b874d8bfed 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -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; diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 44b7b6bceb..4ae6f70d6c 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -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) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index d4b8445ed9..c38ea65f90 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -278,7 +278,6 @@ namespace osu.Game.Screens.Play { if (!pauseContainer.IsPaused) decoupledClock.Start(); - }); pauseContainer.Alpha = 0; diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 26820fc388..3f8d6af320 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -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; diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index abe54375cc..81db49b658 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -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 } } }; diff --git a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs index 3eea239f55..d3d2a18cfa 100644 --- a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs +++ b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs @@ -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; From 23a7045eeff82b7b39a575a115d272f22d917acb Mon Sep 17 00:00:00 2001 From: John Neijzen Date: Wed, 7 Jun 2017 20:07:18 +0800 Subject: [PATCH 2/4] More Clean UP --- osu.Game/Configuration/OsuConfigManager.cs | 7 ------- osu.Game/Overlays/ChatOverlay.cs | 5 ++--- osu.Game/Screens/Select/BeatmapCarousel.cs | 10 +++++----- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 3f56dc0b79..6b07d5c967 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -13,7 +13,6 @@ namespace osu.Game.Configuration protected override void InitialiseDefaults() { // UI/selection defaults - Set(OsuSetting.Ruleset, 0, 0, int.MaxValue); Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details); @@ -25,7 +24,6 @@ namespace osu.Game.Configuration Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1); // Online settings - Set(OsuSetting.Username, string.Empty); Set(OsuSetting.Token, string.Empty); @@ -40,14 +38,12 @@ namespace osu.Game.Configuration }; // Audio - Set(OsuSetting.MenuVoice, true); Set(OsuSetting.MenuMusic, true); Set(OsuSetting.AudioOffset, 0, -500.0, 500.0); // Input - Set(OsuSetting.MenuCursorSize, 1.0, 0.5f, 2); Set(OsuSetting.GameplayCursorSize, 1.0, 0.5f, 2); Set(OsuSetting.AutoCursorSize, false); @@ -56,7 +52,6 @@ namespace osu.Game.Configuration Set(OsuSetting.MouseDisableWheel, false); // Graphics - Set(OsuSetting.ShowFpsDisplay, false); Set(OsuSetting.MenuParallax, true); @@ -65,7 +60,6 @@ namespace osu.Game.Configuration Set(OsuSetting.SnakingOutSliders, true); // Gameplay - Set(OsuSetting.DimLevel, 0.3, 0, 1); Set(OsuSetting.ShowInterface, true); @@ -75,7 +69,6 @@ namespace osu.Game.Configuration Set(OsuSetting.PlaybackSpeed, 1.0, 0.5f, 2); // Update - Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer); } diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index c32199f881..5ec7331578 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -122,7 +122,7 @@ namespace osu.Game.Overlays { Top = padding * 2, Bottom = padding * 2, - Left = ChatLine.LEFT_PADDING + padding * 2, + Left = ChatLine.LEFT_PADDING + (padding * 2), Right = padding * 2, }, Children = new Drawable[] @@ -202,7 +202,7 @@ namespace osu.Game.Overlays { Trace.Assert(state.Mouse.PositionMouseDown != null); - chatHeight.Value = startDragChatHeight - (state.Mouse.Position.Y - state.Mouse.PositionMouseDown.Value.Y) / Parent.DrawSize.Y; + chatHeight.Value = startDragChatHeight - ((state.Mouse.Position.Y - state.Mouse.PositionMouseDown.Value.Y) / Parent.DrawSize.Y); return base.OnDrag(state); } @@ -367,7 +367,6 @@ namespace osu.Game.Overlays } else { - careChannels.Add(channel); channelTabs.AddItem(channel); } diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 3f8d6af320..d51978a683 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -311,7 +311,7 @@ namespace osu.Game.Screens.Select foreach (BeatmapPanel panel in group.BeatmapPanels) { if (panel == selectedPanel) - selectedY = currentY + panel.DrawHeight / 2 - DrawHeight / 2; + selectedY = ((currentY + (panel.DrawHeight / 2)) - (DrawHeight / 2)); panel.MoveToX(-50, 500, EasingTypes.OutExpo); @@ -477,7 +477,7 @@ namespace osu.Game.Screens.Select { // The radius of the circle the carousel moves on. const float circle_radius = 3; - double discriminant = Math.Max(0, circle_radius * circle_radius - dist * dist); + double discriminant = Math.Max(0, (circle_radius * circle_radius) - (dist * dist)); float x = (circle_radius - (float)Math.Sqrt(discriminant)) * halfHeight; return 125 + x; @@ -493,8 +493,8 @@ namespace osu.Game.Screens.Select { var height = p.IsPresent ? p.DrawHeight : 0; - float panelDrawY = p.Position.Y - Current + height / 2; - float dist = Math.Abs(1f - panelDrawY / halfHeight); + float panelDrawY = (p.Position.Y - Current) + (height / 2); + float dist = Math.Abs(1f - (panelDrawY / halfHeight)); // Setting the origin position serves as an additive position on top of potential // local transformation we may want to apply (e.g. when a panel gets selected, we @@ -504,7 +504,7 @@ namespace osu.Game.Screens.Select // We are applying a multiplicative alpha (which is internally done by nesting an // additional container and setting that container's alpha) such that we can // layer transformations on top, with a similar reasoning to the previous comment. - p.SetMultiplicativeAlpha(MathHelper.Clamp(1.75f - 1.5f * dist, 0, 1)); + p.SetMultiplicativeAlpha(MathHelper.Clamp(1.75f - (1.5f * dist), 0, 1)); } } } From f9c466eee9c94a67231dd4ead6c80415b8ddb0c2 Mon Sep 17 00:00:00 2001 From: John Neijzen Date: Wed, 7 Jun 2017 20:12:16 +0800 Subject: [PATCH 3/4] bit more readable --- osu.Game/Screens/Select/BeatmapCarousel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index d51978a683..c1d6d2eb9d 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -311,7 +311,7 @@ namespace osu.Game.Screens.Select foreach (BeatmapPanel panel in group.BeatmapPanels) { if (panel == selectedPanel) - selectedY = ((currentY + (panel.DrawHeight / 2)) - (DrawHeight / 2)); + selectedY = currentY + (panel.DrawHeight / 2) - (DrawHeight / 2); panel.MoveToX(-50, 500, EasingTypes.OutExpo); From aa3a231763b546bb75490e8a3898815127a56017 Mon Sep 17 00:00:00 2001 From: John Neijzen Date: Wed, 7 Jun 2017 22:00:14 +0800 Subject: [PATCH 4/4] Review Changes --- osu.Game/Graphics/Cursor/CursorTrail.cs | 4 ++-- osu.Game/Overlays/ChatOverlay.cs | 4 ++-- osu.Game/Screens/Menu/Button.cs | 15 ++++++--------- osu.Game/Screens/Menu/OsuLogo.cs | 4 ++-- osu.Game/Screens/Select/BeatmapCarousel.cs | 10 +++++----- osu.Game/Screens/Select/BeatmapDetails.cs | 5 +---- .../Screens/Tournament/ScrollingTeamContainer.cs | 12 +++--------- 7 files changed, 21 insertions(+), 33 deletions(-) diff --git a/osu.Game/Graphics/Cursor/CursorTrail.cs b/osu.Game/Graphics/Cursor/CursorTrail.cs index 754390047f..11475a0f19 100644 --- a/osu.Game/Graphics/Cursor/CursorTrail.cs +++ b/osu.Game/Graphics/Cursor/CursorTrail.cs @@ -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); diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 5ec7331578..08b40b6079 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -122,7 +122,7 @@ namespace osu.Game.Overlays { Top = padding * 2, Bottom = padding * 2, - Left = ChatLine.LEFT_PADDING + (padding * 2), + Left = ChatLine.LEFT_PADDING + padding * 2, Right = padding * 2, }, Children = new Drawable[] @@ -202,7 +202,7 @@ namespace osu.Game.Overlays { Trace.Assert(state.Mouse.PositionMouseDown != null); - chatHeight.Value = startDragChatHeight - ((state.Mouse.Position.Y - state.Mouse.PositionMouseDown.Value.Y) / Parent.DrawSize.Y); + chatHeight.Value = startDragChatHeight - (state.Mouse.Position.Y - state.Mouse.PositionMouseDown.Value.Y) / Parent.DrawSize.Y; return base.OnDrag(state); } diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index b874d8bfed..1451bf2619 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -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,7 @@ namespace osu.Game.Screens.Menu public ButtonState State { - get - { - return state; - } + get{ return state; } set { diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 4ae6f70d6c..db1f008dcf 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -231,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); @@ -240,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) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index c1d6d2eb9d..3f8d6af320 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -311,7 +311,7 @@ namespace osu.Game.Screens.Select foreach (BeatmapPanel panel in group.BeatmapPanels) { if (panel == selectedPanel) - selectedY = currentY + (panel.DrawHeight / 2) - (DrawHeight / 2); + selectedY = currentY + panel.DrawHeight / 2 - DrawHeight / 2; panel.MoveToX(-50, 500, EasingTypes.OutExpo); @@ -477,7 +477,7 @@ namespace osu.Game.Screens.Select { // The radius of the circle the carousel moves on. const float circle_radius = 3; - double discriminant = Math.Max(0, (circle_radius * circle_radius) - (dist * dist)); + double discriminant = Math.Max(0, circle_radius * circle_radius - dist * dist); float x = (circle_radius - (float)Math.Sqrt(discriminant)) * halfHeight; return 125 + x; @@ -493,8 +493,8 @@ namespace osu.Game.Screens.Select { var height = p.IsPresent ? p.DrawHeight : 0; - float panelDrawY = (p.Position.Y - Current) + (height / 2); - float dist = Math.Abs(1f - (panelDrawY / halfHeight)); + float panelDrawY = p.Position.Y - Current + height / 2; + float dist = Math.Abs(1f - panelDrawY / halfHeight); // Setting the origin position serves as an additive position on top of potential // local transformation we may want to apply (e.g. when a panel gets selected, we @@ -504,7 +504,7 @@ namespace osu.Game.Screens.Select // We are applying a multiplicative alpha (which is internally done by nesting an // additional container and setting that container's alpha) such that we can // layer transformations on top, with a similar reasoning to the previous comment. - p.SetMultiplicativeAlpha(MathHelper.Clamp(1.75f - (1.5f * dist), 0, 1)); + p.SetMultiplicativeAlpha(MathHelper.Clamp(1.75f - 1.5f * dist, 0, 1)); } } } diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 81db49b658..2aec489508 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -46,10 +46,7 @@ namespace osu.Game.Screens.Select public BeatmapInfo Beatmap { - get - { - return beatmap; - } + get { return beatmap; } set { diff --git a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs index d3d2a18cfa..31043a411b 100644 --- a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs +++ b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs @@ -82,10 +82,7 @@ namespace osu.Game.Screens.Tournament private ScrollState _scrollState; private ScrollState scrollState { - get - { - return _scrollState; - } + get { return _scrollState; } set { @@ -265,7 +262,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; @@ -332,10 +329,7 @@ namespace osu.Game.Screens.Tournament private bool selected; public bool Selected { - get - { - return selected; - } + get { return selected; } set {