From 19fb03e73763cdfda42a5dafe5d39c153b11e6a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 16 Jul 2017 18:28:20 +0300 Subject: [PATCH] Try different formatting style --- .../Tests/TestCaseContextMenu.cs | 12 ++++----- .../Objects/Drawables/DrawableHitCircle.cs | 19 ++++++++++---- .../Objects/Drawables/DrawableSwell.cs | 6 +++-- .../Objects/Drawables/Pieces/CirclePiece.cs | 6 +++-- .../Graphics/UserInterface/TwoLayerButton.cs | 3 ++- osu.Game/Overlays/MedalOverlay.cs | 4 ++- .../Overlays/MedalSplash/DrawableMedal.cs | 12 ++++++--- osu.Game/Overlays/Mods/ModButton.cs | 9 +++++-- osu.Game/Overlays/OnScreenDisplay.cs | 6 +++-- osu.Game/Screens/Menu/Button.cs | 6 +++-- osu.Game/Screens/Menu/ButtonSystem.cs | 4 ++- osu.Game/Screens/Menu/MenuSideFlashes.cs | 3 ++- osu.Game/Screens/Menu/OsuLogo.cs | 25 +++++++++++++------ osu.Game/Screens/Play/Player.cs | 7 ++++-- osu.Game/Screens/Ranking/Results.cs | 13 +++++++--- 15 files changed, 94 insertions(+), 41 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseContextMenu.cs b/osu.Desktop.VisualTests/Tests/TestCaseContextMenu.cs index d89397e793..bf8f9bf7f4 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseContextMenu.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseContextMenu.cs @@ -60,12 +60,12 @@ namespace osu.Desktop.VisualTests.Tests base.LoadComplete(); // Move box along a square trajectory - container - .MoveTo(new Vector2(0, 100), duration) - .Then().MoveTo(new Vector2(100, 100), duration) - .Then().MoveTo(new Vector2(100, 0), duration) - .Then().MoveTo(Vector2.Zero, duration) - .Loop(); + container.Loop(c => c + .MoveTo(new Vector2(0, 100), duration).Then() + .MoveTo(new Vector2(100, 100), duration).Then() + .MoveTo(new Vector2(100, 0), duration).Then() + .MoveTo(Vector2.Zero, duration) + ); } private class MyContextMenuContainer : Container, IHasContextMenu diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index ec047d2aa8..a890a0cdb4 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -129,13 +129,22 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables ApproachCircle.FadeOut(50); const double flash_in = 40; - flash.FadeTo(0.8f, flash_in).Then().FadeOut(100); + flash.FadeTo(0.8f, flash_in) + .Then() + .FadeOut(100); + explode.FadeIn(flash_in); - ring.Delay(flash_in).FadeOut(); - circle.Delay(flash_in).FadeOut(); - number.Delay(flash_in).FadeOut(); - this.Delay(flash_in).FadeOut(800).ScaleTo(Scale * 1.5f, 400, EasingTypes.OutQuad); + using (BeginDelayedSequence(flash_in, true)) + { + //after the flash, we can hide some elements that were behind it + ring.FadeOut(); + circle.FadeOut(); + number.FadeOut(); + + this.FadeOut(800) + .ScaleTo(Scale * 1.5f, 400, EasingTypes.OutQuad); + } Expire(); break; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs index 5f989579a2..363dcae883 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs @@ -147,8 +147,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables var completion = (float)userHits / HitObject.RequiredHits; - expandingRing.FadeTo(expandingRing.Alpha + MathHelper.Clamp(completion / 16, 0.1f, 0.6f), 50) - .Then().FadeTo(completion / 8, 2000, EasingTypes.OutQuint); + expandingRing + .FadeTo(expandingRing.Alpha + MathHelper.Clamp(completion / 16, 0.1f, 0.6f), 50) + .Then() + .FadeTo(completion / 8, 2000, EasingTypes.OutQuint); symbol.RotateTo((float)(completion * HitObject.Duration / 8), 4000, EasingTypes.OutQuint); diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs index cd7e70eff3..a4cd026e4c 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs @@ -166,8 +166,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces double duration = timingPoint.BeatLength * 2; - background.FadeEdgeEffectTo(1, pre_beat_transition_time, EasingTypes.OutQuint) - .Then().FadeEdgeEffectTo(edge_alpha_kiai, duration, EasingTypes.OutQuint); + background + .FadeEdgeEffectTo(1, pre_beat_transition_time, EasingTypes.OutQuint) + .Then() + .FadeEdgeEffectTo(edge_alpha_kiai, duration, EasingTypes.OutQuint); } } } \ No newline at end of file diff --git a/osu.Game/Graphics/UserInterface/TwoLayerButton.cs b/osu.Game/Graphics/UserInterface/TwoLayerButton.cs index 32903b4eaf..b763cd7971 100644 --- a/osu.Game/Graphics/UserInterface/TwoLayerButton.cs +++ b/osu.Game/Graphics/UserInterface/TwoLayerButton.cs @@ -246,7 +246,8 @@ namespace osu.Game.Graphics.UserInterface if (beatIndex < 0) return; icon.ScaleTo(1 - 0.1f * amplitudeAdjust, beat_in_time, EasingTypes.Out) - .Then().ScaleTo(1, beatLength * 2, EasingTypes.OutQuint); + .Then() + .ScaleTo(1, beatLength * 2, EasingTypes.OutQuint); } } } diff --git a/osu.Game/Overlays/MedalOverlay.cs b/osu.Game/Overlays/MedalOverlay.cs index 627e485993..c3825e32b8 100644 --- a/osu.Game/Overlays/MedalOverlay.cs +++ b/osu.Game/Overlays/MedalOverlay.cs @@ -204,7 +204,9 @@ namespace osu.Game.Overlays using (BeginDelayedSequence(200, true)) { - disc.FadeIn(initial_duration).ScaleTo(1f, initial_duration * 2, EasingTypes.OutElastic); + disc.FadeIn(initial_duration) + .ScaleTo(1f, initial_duration * 2, EasingTypes.OutElastic); + particleContainer.FadeIn(initial_duration); outerSpin.FadeTo(0.1f, initial_duration * 2); diff --git a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs index 166b8e8d41..89e991f5ef 100644 --- a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs +++ b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs @@ -147,17 +147,23 @@ namespace osu.Game.Overlays.MedalSplash medalContainer.ScaleTo(0); break; case DisplayState.Icon: - medalContainer.FadeIn(duration).ScaleTo(1, duration, EasingTypes.OutElastic); + medalContainer + .FadeIn(duration) + .ScaleTo(1, duration, EasingTypes.OutElastic); break; case DisplayState.MedalUnlocked: - medalContainer.FadeTo(1).ScaleTo(1); + medalContainer + .FadeTo(1) + .ScaleTo(1); this.ScaleTo(scale_when_unlocked, duration, EasingTypes.OutExpo); this.MoveToY(MedalOverlay.DISC_SIZE / 2 - 30, duration, EasingTypes.OutExpo); unlocked.FadeInFromZero(duration); break; case DisplayState.Full: - medalContainer.FadeTo(1).ScaleTo(1); + medalContainer + .FadeTo(1) + .ScaleTo(1); this.ScaleTo(scale_when_full, duration, EasingTypes.OutExpo); this.MoveToY(MedalOverlay.DISC_SIZE / 2 - 60, duration, EasingTypes.OutExpo); diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index 45da537a60..bea0aae57e 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -81,8 +81,13 @@ namespace osu.Game.Overlays.Mods backgroundIcon.Icon = modAfter.Icon; using (BeginDelayedSequence(mod_switch_duration, true)) { - foregroundIcon.RotateTo(-rotate_angle * direction).RotateTo(0f, mod_switch_duration, mod_switch_easing); - backgroundIcon.RotateTo(rotate_angle * direction).RotateTo(0f, mod_switch_duration, mod_switch_easing); + foregroundIcon + .RotateTo(-rotate_angle * direction) + .RotateTo(0f, mod_switch_duration, mod_switch_easing); + + backgroundIcon + .RotateTo(rotate_angle * direction) + .RotateTo(0f, mod_switch_duration, mod_switch_easing); Schedule(() => displayMod(modAfter)); } diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index 93e2cdfbbc..e6a55800ef 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -155,9 +155,11 @@ namespace osu.Game.Overlays textLine3.Text = shortcut.ToUpper(); box.Animate( - b => b.FadeIn(500, EasingTypes.OutQuint).ResizeHeightTo(height, 500, EasingTypes.OutQuint) + b => b.FadeIn(500, EasingTypes.OutQuint), + b => b.ResizeHeightTo(height, 500, EasingTypes.OutQuint) ).Then( - b => b.FadeOutFromOne(1500, EasingTypes.InQuint).ResizeHeightTo(height_contracted, 1500, EasingTypes.InQuint) + b => b.FadeOutFromOne(1500, EasingTypes.InQuint), + b => b.ResizeHeightTo(height_contracted, 1500, EasingTypes.InQuint) ); int optionCount = 0; diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index 4b5d815c02..e04e3ce66b 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -131,9 +131,11 @@ namespace osu.Game.Screens.Menu icon.RotateTo(rightward ? 10 : -10, duration * 2, EasingTypes.InOutSine); icon.Animate( - i => i.MoveToY(-10, duration, EasingTypes.Out).ScaleTo(1, duration, EasingTypes.Out) + i => i.MoveToY(-10, duration, EasingTypes.Out), + i => i.ScaleTo(1, duration, EasingTypes.Out) ).Then( - i => i.MoveToY(0, duration, EasingTypes.In).ScaleTo(new Vector2(1, 0.9f), duration, EasingTypes.In) + i => i.MoveToY(0, duration, EasingTypes.In), + i => i.ScaleTo(new Vector2(1, 0.9f), duration, EasingTypes.In) ); } diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index e27cf666c0..87f8e32abd 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -229,7 +229,9 @@ namespace osu.Game.Screens.Menu buttonAreaBackground.ScaleTo(Vector2.One, 500, EasingTypes.Out); buttonArea.FadeOut(300); - osuLogo.Delay(150).ScaleTo(1, 800, EasingTypes.OutExpo).MoveTo(Vector2.Zero, 800, EasingTypes.OutExpo); + osuLogo.Delay(150) + .ScaleTo(1, 800, EasingTypes.OutExpo) + .MoveTo(Vector2.Zero, 800, EasingTypes.OutExpo); foreach (Button b in buttonsTopLevel) b.State = ButtonState.Contracted; diff --git a/osu.Game/Screens/Menu/MenuSideFlashes.cs b/osu.Game/Screens/Menu/MenuSideFlashes.cs index 4b7c2a0e00..fdacccd913 100644 --- a/osu.Game/Screens/Menu/MenuSideFlashes.cs +++ b/osu.Game/Screens/Menu/MenuSideFlashes.cs @@ -91,7 +91,8 @@ namespace osu.Game.Screens.Menu private void flash(Drawable d, double beatLength, bool kiai, TrackAmplitudes amplitudes) { d.FadeTo(Math.Max(0, ((d.Equals(leftBox) ? amplitudes.LeftChannel : amplitudes.RightChannel) - amplitude_dead_zone) / (kiai ? kiai_multiplier : alpha_multiplier)), box_fade_in_time) - .Then().FadeOut(beatLength, EasingTypes.In); + .Then() + .FadeOut(beatLength, EasingTypes.In); } } } diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index db2bffa079..c5d4cbb9b1 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -239,21 +239,30 @@ namespace osu.Game.Screens.Menu if (IsHovered) this.Delay(early_activation).Schedule(() => sampleBeat.Play()); - logoBeatContainer.ScaleTo(1 - 0.02f * amplitudeAdjust, early_activation, EasingTypes.Out) - .Then().ScaleTo(1, beatLength * 2, EasingTypes.OutQuint); + logoBeatContainer + .ScaleTo(1 - 0.02f * amplitudeAdjust, early_activation, EasingTypes.Out) + .Then() + .ScaleTo(1, beatLength * 2, EasingTypes.OutQuint); ripple.ClearTransforms(); - - ripple.ScaleTo(logoAmplitudeContainer.Scale).ScaleTo(logoAmplitudeContainer.Scale * (1 + 0.04f * amplitudeAdjust), beatLength, EasingTypes.OutQuint); - ripple.FadeTo(0.15f * amplitudeAdjust).FadeOut(beatLength, EasingTypes.OutQuint); + ripple + .ScaleTo(logoAmplitudeContainer.Scale) + .ScaleTo(logoAmplitudeContainer.Scale * (1 + 0.04f * amplitudeAdjust), beatLength, EasingTypes.OutQuint) + .FadeTo(0.15f * amplitudeAdjust).FadeOut(beatLength, EasingTypes.OutQuint); if (effectPoint.KiaiMode && flashLayer.Alpha < 0.4f) { flashLayer.ClearTransforms(); - visualizer.ClearTransforms(); + flashLayer + .FadeTo(0.2f * amplitudeAdjust, early_activation, EasingTypes.Out) + .Then() + .FadeOut(beatLength); - flashLayer.FadeTo(0.2f * amplitudeAdjust, early_activation, EasingTypes.Out).Then().FadeOut(beatLength); - visualizer.FadeTo(0.9f * amplitudeAdjust, early_activation, EasingTypes.Out).Then().FadeTo(0.5f, beatLength); + visualizer.ClearTransforms(); + visualizer + .FadeTo(0.9f * amplitudeAdjust, early_activation, EasingTypes.Out) + .Then() + .FadeTo(0.5f, beatLength); } } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index aafe459800..6ccc80beb3 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -272,8 +272,11 @@ namespace osu.Game.Screens.Play dimLevel.ValueChanged += newDim => Background?.FadeTo(1 - (float)newDim, 800); - Content.ScaleTo(0.7f).ScaleTo(1, 750, EasingTypes.OutQuint); - Content.Delay(250).FadeIn(250); + Content + .ScaleTo(0.7f) + .ScaleTo(1, 750, EasingTypes.OutQuint) + .Delay(250) + .FadeIn(250); this.Delay(750).Schedule(() => { diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 34e9cd186f..7b29cab027 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -67,16 +67,23 @@ namespace osu.Game.Screens.Ranking modeChangeButtons.FadeOut(); currentPage.FadeOut(); - circleOuterBackground.FadeIn(transition_time, EasingTypes.OutQuint).ScaleTo(1, transition_time, EasingTypes.OutQuint); + circleOuterBackground + .FadeIn(transition_time, EasingTypes.OutQuint) + .ScaleTo(1, transition_time, EasingTypes.OutQuint); using (BeginDelayedSequence(transition_time * 0.25f, true)) { - circleOuter.FadeIn(transition_time, EasingTypes.OutQuint).ScaleTo(1, transition_time, EasingTypes.OutQuint); + circleOuter + .FadeIn(transition_time, EasingTypes.OutQuint) + .ScaleTo(1, transition_time, EasingTypes.OutQuint); using (BeginDelayedSequence(transition_time * 0.3f, true)) { backgroundParallax.FadeIn(transition_time, EasingTypes.OutQuint); - circleInner.FadeIn(transition_time, EasingTypes.OutQuint).ScaleTo(1, transition_time, EasingTypes.OutQuint); + + circleInner + .FadeIn(transition_time, EasingTypes.OutQuint) + .ScaleTo(1, transition_time, EasingTypes.OutQuint); using (BeginDelayedSequence(transition_time * 0.4f, true)) {