diff --git a/osu-framework b/osu-framework index 991177da4f..cb2c9dd8b6 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 991177da4fbed2dd8260c215f2d341ebc858b03e +Subproject commit cb2c9dd8b6213cd8f91cc37892da6335ca3bce10 diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs index 909ee9b134..8b682d14ce 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs @@ -15,6 +15,7 @@ using osu.Game.Graphics.Sprites; using osu.Framework.Lists; using System; using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics.Transforms; namespace osu.Desktop.VisualTests.Tests { diff --git a/osu.Desktop.VisualTests/Tests/TestCaseContextMenu.cs b/osu.Desktop.VisualTests/Tests/TestCaseContextMenu.cs index f9dc424153..cfb618e5d1 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseContextMenu.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseContextMenu.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Transforms; using osu.Framework.Graphics.UserInterface; using osu.Framework.Testing; using osu.Game.Graphics.UserInterface; @@ -59,20 +60,13 @@ namespace osu.Desktop.VisualTests.Tests { base.LoadComplete(); - using (container.BeginLoopedSequence()) - { - container.MoveTo(new Vector2(0, 100), duration); - using (container.BeginDelayedSequence(duration)) - { - container.MoveTo(new Vector2(100, 100), duration); - using (container.BeginDelayedSequence(duration)) - { - container.MoveTo(new Vector2(100, 0), duration); - using (container.BeginDelayedSequence(duration)) - container.MoveTo(Vector2.Zero, duration); - } - } - } + // Move box along a square trajectory + container.Loop(b => b + .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 @@ -95,10 +89,10 @@ namespace osu.Desktop.VisualTests.Tests { new OsuContextMenuItem(@"Simple option"), new OsuContextMenuItem(@"Simple very very long option"), - new OsuContextMenuItem(@"Change width", MenuItemType.Highlighted) { Action = () => ResizeWidthTo(Width * 2, 100, EasingTypes.OutQuint) }, - new OsuContextMenuItem(@"Change height", MenuItemType.Highlighted) { Action = () => ResizeHeightTo(Height * 2, 100, EasingTypes.OutQuint) }, - new OsuContextMenuItem(@"Change width back", MenuItemType.Destructive) { Action = () => ResizeWidthTo(Width / 2, 100, EasingTypes.OutQuint) }, - new OsuContextMenuItem(@"Change height back", MenuItemType.Destructive) { Action = () => ResizeHeightTo(Height / 2, 100, EasingTypes.OutQuint) }, + new OsuContextMenuItem(@"Change width", MenuItemType.Highlighted) { Action = () => this.ResizeWidthTo(Width * 2, 100, EasingTypes.OutQuint) }, + new OsuContextMenuItem(@"Change height", MenuItemType.Highlighted) { Action = () => this.ResizeHeightTo(Height * 2, 100, EasingTypes.OutQuint) }, + new OsuContextMenuItem(@"Change width back", MenuItemType.Destructive) { Action = () => this.ResizeWidthTo(Width / 2, 100, EasingTypes.OutQuint) }, + new OsuContextMenuItem(@"Change height back", MenuItemType.Destructive) { Action = () => this.ResizeHeightTo(Height / 2, 100, EasingTypes.OutQuint) }, }; } } diff --git a/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs b/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs index 87a40a76ca..7a4584d4f8 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs @@ -13,6 +13,7 @@ using osu.Framework.MathUtils; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Game.Screens.Play; +using osu.Framework.Graphics.Transforms; namespace osu.Desktop.VisualTests.Tests { diff --git a/osu.Desktop.VisualTests/Tests/TestCaseScrollingHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseScrollingHitObjects.cs index 8e5cf8687c..33b7399343 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseScrollingHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseScrollingHitObjects.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Transforms; using osu.Framework.Graphics.UserInterface; using osu.Framework.Testing; using osu.Game.Graphics.Sprites; @@ -196,7 +197,7 @@ namespace osu.Desktop.VisualTests.Tests protected override void LoadComplete() { base.LoadComplete(); - FadeInFromZero(250, EasingTypes.OutQuint); + this.FadeInFromZero(250, EasingTypes.OutQuint); } protected override void Update() diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index 00929c06c2..4fd27220bc 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -4,6 +4,7 @@ using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Transforms; using osu.Framework.MathUtils; using osu.Framework.Testing; using osu.Framework.Timing; diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index a8ab97ce37..5b79ecfaf1 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -175,7 +175,7 @@ namespace osu.Desktop.Overlays protected override void PopIn() { - FadeIn(1000); + this.FadeIn(1000); } protected override void PopOut() diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 3feb448752..133e1ba861 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -17,7 +17,6 @@ using System.Collections.Generic; using osu.Game.Rulesets.Objects.Drawables; using osu.Framework.Input; using osu.Framework.Graphics.Transforms; -using osu.Framework.MathUtils; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Timing; using osu.Framework.Configuration; @@ -235,7 +234,7 @@ namespace osu.Game.Rulesets.Mania.UI private void transformVisibleTimeRangeTo(double newTimeRange, double duration = 0, EasingTypes easing = EasingTypes.None) { - TransformTo(newTimeRange, duration, easing, new TransformTimeSpan()); + this.TransformTo(newTimeRange, duration, easing, new TransformTimeSpan(this)); } protected override void Update() @@ -245,22 +244,14 @@ namespace osu.Game.Rulesets.Mania.UI barLineContainer.Width = columns.Width; } - private class TransformTimeSpan : Transform + private class TransformTimeSpan : TransformDouble { - public double CurrentValue + public TransformTimeSpan(ManiaPlayfield target) : base(target) { - get - { - double time = Time?.Current ?? 0; - if (time < StartTime) return StartValue; - if (time >= EndTime) return EndValue; - - return Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing); - } } - public override void Apply(Drawable d) => ((ManiaPlayfield)d).visibleTimeRange.Value = (float)CurrentValue; - public override void ReadIntoStartValue(Drawable d) => StartValue = ((ManiaPlayfield)d).visibleTimeRange.Value; + public override void Apply(ManiaPlayfield d) => d.visibleTimeRange.Value = CurrentValue; + public override void ReadIntoStartValue(ManiaPlayfield d) => StartValue = d.visibleTimeRange.Value; } } } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index 75b2dc0a32..947af733ec 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -119,12 +119,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { case ArmedState.Idle: using (BeginDelayedSequence(duration + TIME_PREEMPT)) - FadeOut(TIME_FADEOUT); + this.FadeOut(TIME_FADEOUT); Expire(true); break; case ArmedState.Miss: ApproachCircle.FadeOut(50); - FadeOut(TIME_FADEOUT / 5); + this.FadeOut(TIME_FADEOUT / 5); Expire(); break; case ArmedState.Hit: @@ -145,8 +145,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables circle.FadeOut(); number.FadeOut(); - FadeOut(800); - ScaleTo(Scale * 1.5f, 400, EasingTypes.OutQuad); + this.FadeOut(800); + this.ScaleTo(Scale * 1.5f, 400, EasingTypes.OutQuad); } Expire(); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index 2711ec1a62..e09b6bd997 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Osu.Judgements; +using osu.Framework.Graphics; namespace osu.Game.Rulesets.Osu.Objects.Drawables { @@ -44,7 +45,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables protected virtual void UpdatePreemptState() { - FadeIn(TIME_FADEIN); + this.FadeIn(TIME_FADEIN); } protected virtual void UpdateCurrentState(ArmedState state) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index c6c009e8f2..c3c7d8862f 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -163,7 +163,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables body.FadeOut(160); ball.FadeOut(160); - FadeOut(800); + this.FadeOut(800); Expire(); } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index 28fbf46a92..6ced16930b 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -62,12 +62,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { var animIn = Math.Min(150, sliderTick.StartTime - FadeInTime); - ScaleTo(0.5f); - ScaleTo(1.2f, animIn); - FadeIn(animIn); + this.ScaleTo(0.5f); + this.ScaleTo(1.2f, animIn); + this.FadeIn(animIn); Delay(animIn); - ScaleTo(1, 150, EasingTypes.Out); + this.ScaleTo(1, 150, EasingTypes.Out); Delay(-animIn); } @@ -78,15 +78,15 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { case ArmedState.Idle: Delay(FadeOutTime - sliderTick.StartTime); - FadeOut(); + this.FadeOut(); break; case ArmedState.Miss: - FadeOut(160); - FadeColour(Color4.Red, 80); + this.FadeOut(160); + this.FadeColour(Color4.Red, 80); break; case ArmedState.Hit: - FadeOut(120, EasingTypes.OutQuint); - ScaleTo(Scale * 1.5f, 120, EasingTypes.OutQuint); + this.FadeOut(120, EasingTypes.OutQuint); + this.ScaleTo(Scale * 1.5f, 120, EasingTypes.OutQuint); break; } } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index 840acb8221..0ac790c520 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -200,16 +200,16 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { Delay(spinner.Duration, true); - FadeOut(160); + this.FadeOut(160); switch (state) { case ArmedState.Hit: - ScaleTo(Scale * 1.2f, 320, EasingTypes.Out); + this.ScaleTo(Scale * 1.2f, 320, EasingTypes.Out); Expire(); break; case ArmedState.Miss: - ScaleTo(Scale * 0.8f, 320, EasingTypes.In); + this.ScaleTo(Scale * 0.8f, 320, EasingTypes.In); Expire(); break; } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBouncer.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBouncer.cs index a34ff30a43..a15812054f 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBouncer.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBouncer.cs @@ -37,8 +37,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces protected override void LoadComplete() { base.LoadComplete(); - using (icon.BeginLoopedSequence()) - icon.RotateTo(360, 1000); + icon.Spin(1000); } public void UpdateProgress(double progress, int repeat) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs index f3ddf683d2..a30b03fa63 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs @@ -133,7 +133,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces background.FadeTo(tracking_alpha, 250, EasingTypes.OutQuint); } - RotateTo(currentRotation / 2, validAndTracking ? 500 : 1500, EasingTypes.OutExpo); + this.RotateTo(currentRotation / 2, validAndTracking ? 500 : 1500, EasingTypes.OutExpo); } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs index 5d627f2b50..841964b743 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs @@ -65,10 +65,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables { base.LoadComplete(); Delay(BarLine.StartTime - Time.Current); - FadeOut(base_fadeout_time * BarLine.ScrollTime / 1000); + this.FadeOut(base_fadeout_time * BarLine.ScrollTime / 1000); } - private void updateScrollPosition(double time) => MoveToX((float)((BarLine.StartTime - time) / BarLine.ScrollTime)); + private void updateScrollPosition(double time) => this.MoveToX((float)((BarLine.StartTime - time) / BarLine.ScrollTime)); protected override void Update() { diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index a4a46e3b48..53518a28de 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -77,10 +77,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables Delay(HitObject.HitWindowMiss); break; case ArmedState.Miss: - FadeOut(100); + this.FadeOut(100); break; case ArmedState.Hit: - FadeOut(600); + this.FadeOut(600); var flash = circlePiece?.FlashBox; if (flash != null) @@ -90,16 +90,16 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables } - FadeOut(800); + this.FadeOut(800); const float gravity_time = 300; const float gravity_travel_height = 200; Content.ScaleTo(0.8f, gravity_time * 2, EasingTypes.OutQuad); - MoveToY(-gravity_travel_height, gravity_time, EasingTypes.Out); + this.MoveToY(-gravity_travel_height, gravity_time, EasingTypes.Out); Delay(gravity_time, true); - MoveToY(gravity_travel_height * 2, gravity_time * 2, EasingTypes.In); + this.MoveToY(gravity_travel_height * 2, gravity_time * 2, EasingTypes.In); break; } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs index 1c72f2a7dd..43f6bc930c 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs @@ -198,7 +198,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables break; } - FadeOut(out_transition_time, EasingTypes.Out); + this.FadeOut(out_transition_time, EasingTypes.Out); Expire(); } diff --git a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs index 08fd8dbecc..779471b8dc 100644 --- a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs @@ -6,6 +6,7 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Framework.Allocation; using osu.Game.Graphics; using osu.Game.Rulesets.Judgements; +using osu.Framework.Graphics; namespace osu.Game.Rulesets.Taiko.UI { @@ -47,7 +48,7 @@ namespace osu.Game.Rulesets.Taiko.UI switch (Judgement.Result) { case HitResult.Hit: - MoveToY(-100, 500); + this.MoveToY(-100, 500); break; } diff --git a/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs b/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs index 4d39ba0ead..8766f7b9f5 100644 --- a/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs +++ b/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs @@ -62,8 +62,8 @@ namespace osu.Game.Rulesets.Taiko.UI { base.LoadComplete(); - ScaleTo(3f, 1000, EasingTypes.OutQuint); - FadeOut(500); + this.ScaleTo(3f, 1000, EasingTypes.OutQuint); + this.FadeOut(500); Expire(); } @@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.Taiko.UI /// public void VisualiseSecondHit() { - ResizeTo(new Vector2(TaikoPlayfield.HIT_TARGET_OFFSET + TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER), 50); + this.ResizeTo(new Vector2(TaikoPlayfield.HIT_TARGET_OFFSET + TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER), 50); } } } diff --git a/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs b/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs index b4aec7057b..346f435e5d 100644 --- a/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs +++ b/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs @@ -59,8 +59,8 @@ namespace osu.Game.Rulesets.Taiko.UI { base.LoadComplete(); - ScaleTo(new Vector2(1, 3f), 500, EasingTypes.OutQuint); - FadeOut(250); + this.ScaleTo(new Vector2(1, 3f), 500, EasingTypes.OutQuint); + this.FadeOut(250); Expire(); } diff --git a/osu.Game/Beatmaps/Drawables/Panel.cs b/osu.Game/Beatmaps/Drawables/Panel.cs index 3dac50732c..10eeba53e0 100644 --- a/osu.Game/Beatmaps/Drawables/Panel.cs +++ b/osu.Game/Beatmaps/Drawables/Panel.cs @@ -64,9 +64,9 @@ namespace osu.Game.Beatmaps.Drawables } if (state == PanelSelectedState.Hidden) - FadeOut(300, EasingTypes.OutQuint); + this.FadeOut(300, EasingTypes.OutQuint); else - FadeIn(250); + this.FadeIn(250); } private PanelSelectedState state = PanelSelectedState.NotSelected; diff --git a/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs b/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs index 7608a366dc..5ce836bbe5 100644 --- a/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs +++ b/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs @@ -83,13 +83,13 @@ namespace osu.Game.Graphics.Cursor protected override void PopIn() { instantMovement |= !IsPresent; - FadeIn(500, EasingTypes.OutQuint); + this.FadeIn(500, EasingTypes.OutQuint); } protected override void PopOut() { using (BeginDelayedSequence(150)) - FadeOut(500, EasingTypes.OutQuint); + this.FadeOut(500, EasingTypes.OutQuint); } public override void Move(Vector2 pos) @@ -101,7 +101,7 @@ namespace osu.Game.Graphics.Cursor } else { - MoveTo(pos, 200, EasingTypes.OutQuint); + this.MoveTo(pos, 200, EasingTypes.OutQuint); } } } diff --git a/osu.Game/Graphics/IHasAccentColour.cs b/osu.Game/Graphics/IHasAccentColour.cs index 9eb66d8fac..46f9ec4235 100644 --- a/osu.Game/Graphics/IHasAccentColour.cs +++ b/osu.Game/Graphics/IHasAccentColour.cs @@ -27,10 +27,8 @@ namespace osu.Game.Graphics /// The new accent colour. /// The tween duration. /// The tween easing. - public static void FadeAccent(this T accentedDrawable, Color4 newColour, double duration = 0, EasingTypes easing = EasingTypes.None) - where T : Transformable, IHasAccentColour - { - accentedDrawable.TransformTo(newColour, duration, easing, new TransformAccent()); - } + public static TransformContinuation FadeAccent(this T accentedDrawable, Color4 newColour, double duration = 0, EasingTypes easing = EasingTypes.None) + where T : IHasAccentColour + => accentedDrawable.TransformTo(newColour, duration, easing, new TransformAccent(accentedDrawable)); } } diff --git a/osu.Game/Graphics/Transforms/TransformAccent.cs b/osu.Game/Graphics/Transforms/TransformAccent.cs index 53a452ad8a..e609649fd0 100644 --- a/osu.Game/Graphics/Transforms/TransformAccent.cs +++ b/osu.Game/Graphics/Transforms/TransformAccent.cs @@ -2,14 +2,17 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; -using osu.Framework.Graphics; using osu.Framework.Graphics.Transforms; using osu.Framework.MathUtils; namespace osu.Game.Graphics.Transforms { - public class TransformAccent : Transform + public class TransformAccent : Transform { + public TransformAccent(IHasAccentColour target) : base(target) + { + } + /// /// Current value of the transformed colour in linear colour space. /// @@ -25,7 +28,7 @@ namespace osu.Game.Graphics.Transforms } } - public override void Apply(Drawable d) => ((IHasAccentColour)d).AccentColour = CurrentValue; - public override void ReadIntoStartValue(Drawable d) => StartValue = ((IHasAccentColour)d).AccentColour; + public override void Apply(IHasAccentColour d) => d.AccentColour = CurrentValue; + public override void ReadIntoStartValue(IHasAccentColour d) => StartValue = d.AccentColour; } } diff --git a/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs b/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs index 155b08fde8..e69f9e3f42 100644 --- a/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs +++ b/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs @@ -54,13 +54,13 @@ namespace osu.Game.Graphics.UserInterface if (State == Visibility.Visible) { - FadeIn(transition_duration, EasingTypes.OutQuint); - ScaleTo(new Vector2(1f), transition_duration, EasingTypes.OutQuint); + this.FadeIn(transition_duration, EasingTypes.OutQuint); + this.ScaleTo(new Vector2(1f), transition_duration, EasingTypes.OutQuint); } else { - FadeOut(transition_duration, EasingTypes.OutQuint); - ScaleTo(new Vector2(0.8f, 1f), transition_duration, EasingTypes.OutQuint); + this.FadeOut(transition_duration, EasingTypes.OutQuint); + this.ScaleTo(new Vector2(0.8f, 1f), transition_duration, EasingTypes.OutQuint); } } } diff --git a/osu.Game/Graphics/UserInterface/LoadingAnimation.cs b/osu.Game/Graphics/UserInterface/LoadingAnimation.cs index eed5061abd..5e293eff03 100644 --- a/osu.Game/Graphics/UserInterface/LoadingAnimation.cs +++ b/osu.Game/Graphics/UserInterface/LoadingAnimation.cs @@ -34,14 +34,13 @@ namespace osu.Game.Graphics.UserInterface { base.LoadComplete(); - using (spinner.BeginLoopedSequence()) - spinner.RotateTo(360, 2000); + spinner.Spin(2000); } private const float transition_duration = 500; - protected override void PopIn() => FadeIn(transition_duration * 5, EasingTypes.OutQuint); + protected override void PopIn() => this.FadeIn(transition_duration * 5, EasingTypes.OutQuint); - protected override void PopOut() => FadeOut(transition_duration, EasingTypes.OutQuint); + protected override void PopOut() => this.FadeOut(transition_duration, EasingTypes.OutQuint); } } diff --git a/osu.Game/Graphics/UserInterface/Nub.cs b/osu.Game/Graphics/UserInterface/Nub.cs index d5059945c6..298badcb77 100644 --- a/osu.Game/Graphics/UserInterface/Nub.cs +++ b/osu.Game/Graphics/UserInterface/Nub.cs @@ -80,13 +80,13 @@ namespace osu.Game.Graphics.UserInterface if (value) { - FadeColour(GlowingAccentColour, 500, EasingTypes.OutQuint); + this.FadeColour(GlowingAccentColour, 500, EasingTypes.OutQuint); FadeEdgeEffectTo(1, 500, EasingTypes.OutQuint); } else { FadeEdgeEffectTo(0, 500); - FadeColour(AccentColour, 500); + this.FadeColour(AccentColour, 500); } } } @@ -95,7 +95,7 @@ namespace osu.Game.Graphics.UserInterface { set { - ResizeTo(new Vector2(value ? EXPANDED_SIZE : COLLAPSED_SIZE, 12), 500, EasingTypes.OutQuint); + this.ResizeTo(new Vector2(value ? EXPANDED_SIZE : COLLAPSED_SIZE, 12), 500, EasingTypes.OutQuint); } } diff --git a/osu.Game/Graphics/UserInterface/OsuContextMenu.cs b/osu.Game/Graphics/UserInterface/OsuContextMenu.cs index e17ce2a5b2..66c214f6a3 100644 --- a/osu.Game/Graphics/UserInterface/OsuContextMenu.cs +++ b/osu.Game/Graphics/UserInterface/OsuContextMenu.cs @@ -39,13 +39,13 @@ namespace osu.Game.Graphics.UserInterface Background.Colour = colours.ContextMenuGray; } - protected override void AnimateOpen() => FadeIn(fade_duration, EasingTypes.OutQuint); - protected override void AnimateClose() => FadeOut(fade_duration, EasingTypes.OutQuint); + protected override void AnimateOpen() => this.FadeIn(fade_duration, EasingTypes.OutQuint); + protected override void AnimateClose() => this.FadeOut(fade_duration, EasingTypes.OutQuint); protected override void UpdateContentHeight() { var actualHeight = (RelativeSizeAxes & Axes.Y) > 0 ? 1 : ContentHeight; - ResizeTo(new Vector2(1, State == MenuState.Opened ? actualHeight : 0), 300, EasingTypes.OutQuint); + this.ResizeTo(new Vector2(1, State == MenuState.Opened ? actualHeight : 0), 300, EasingTypes.OutQuint); } } } diff --git a/osu.Game/Graphics/UserInterface/OsuMenu.cs b/osu.Game/Graphics/UserInterface/OsuMenu.cs index 84b88da96e..2bcf0a467c 100644 --- a/osu.Game/Graphics/UserInterface/OsuMenu.cs +++ b/osu.Game/Graphics/UserInterface/OsuMenu.cs @@ -19,14 +19,14 @@ namespace osu.Game.Graphics.UserInterface ItemsContainer.Padding = new MarginPadding(5); } - protected override void AnimateOpen() => FadeIn(300, EasingTypes.OutQuint); + protected override void AnimateOpen() => this.FadeIn(300, EasingTypes.OutQuint); - protected override void AnimateClose() => FadeOut(300, EasingTypes.OutQuint); + protected override void AnimateClose() => this.FadeOut(300, EasingTypes.OutQuint); protected override void UpdateContentHeight() { var actualHeight = (RelativeSizeAxes & Axes.Y) > 0 ? 1 : ContentHeight; - ResizeTo(new Vector2(1, State == MenuState.Opened ? actualHeight : 0), 300, EasingTypes.OutQuint); + this.ResizeTo(new Vector2(1, State == MenuState.Opened ? actualHeight : 0), 300, EasingTypes.OutQuint); } } } diff --git a/osu.Game/Graphics/UserInterface/PercentageCounter.cs b/osu.Game/Graphics/UserInterface/PercentageCounter.cs index 4065978de8..0a402f9045 100644 --- a/osu.Game/Graphics/UserInterface/PercentageCounter.cs +++ b/osu.Game/Graphics/UserInterface/PercentageCounter.cs @@ -1,9 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics; -using osu.Framework.Graphics.Transforms; -using osu.Framework.MathUtils; using System; namespace osu.Game.Graphics.UserInterface diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs index ac4e877ae1..47346ce440 100644 --- a/osu.Game/Graphics/UserInterface/RollingCounter.cs +++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs @@ -9,7 +9,6 @@ using osu.Framework.Graphics.Transforms; using osu.Game.Graphics.Sprites; using System; using System.Collections.Generic; -using System.Diagnostics; using OpenTK.Graphics; using osu.Framework.MathUtils; diff --git a/osu.Game/Graphics/UserInterface/ScoreCounter.cs b/osu.Game/Graphics/UserInterface/ScoreCounter.cs index 604185d930..a1fa48e3cd 100644 --- a/osu.Game/Graphics/UserInterface/ScoreCounter.cs +++ b/osu.Game/Graphics/UserInterface/ScoreCounter.cs @@ -2,9 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; -using osu.Framework.Graphics.Transforms; -using osu.Framework.MathUtils; -using System; namespace osu.Game.Graphics.UserInterface { diff --git a/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs b/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs index 16ba8c6d76..211de72efc 100644 --- a/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs +++ b/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs @@ -2,9 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Transforms; -using osu.Framework.MathUtils; namespace osu.Game.Graphics.UserInterface { diff --git a/osu.Game/Graphics/UserInterface/TwoLayerButton.cs b/osu.Game/Graphics/UserInterface/TwoLayerButton.cs index 7f2bbb8f9f..5713f5fe27 100644 --- a/osu.Game/Graphics/UserInterface/TwoLayerButton.cs +++ b/osu.Game/Graphics/UserInterface/TwoLayerButton.cs @@ -173,7 +173,7 @@ namespace osu.Game.Graphics.UserInterface protected override bool OnHover(InputState state) { - ResizeTo(SIZE_EXTENDED, transform_time, EasingTypes.OutElastic); + this.ResizeTo(SIZE_EXTENDED, transform_time, EasingTypes.OutElastic); IconLayer.FadeColour(HoverColour, transform_time, EasingTypes.OutElastic); bouncingIcon.ScaleTo(1.1f, transform_time, EasingTypes.OutElastic); @@ -183,7 +183,7 @@ namespace osu.Game.Graphics.UserInterface protected override void OnHoverLost(InputState state) { - ResizeTo(SIZE_RETRACTED, transform_time, EasingTypes.OutElastic); + this.ResizeTo(SIZE_RETRACTED, transform_time, EasingTypes.OutElastic); IconLayer.FadeColour(TextLayer.Colour, transform_time, EasingTypes.OutElastic); bouncingIcon.ScaleTo(1, transform_time, EasingTypes.OutElastic); diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index a758d5fdef..fd2a7742f8 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -93,14 +93,14 @@ namespace osu.Game.Graphics.UserInterface.Volume protected override void PopIn() { ClearTransforms(); - FadeIn(100); + this.FadeIn(100); schedulePopOut(); } protected override void PopOut() { - FadeOut(100); + this.FadeOut(100); } private void schedulePopOut() diff --git a/osu.Game/Overlays/Chat/ChannelListItem.cs b/osu.Game/Overlays/Chat/ChannelListItem.cs index aca65bbc17..7b11ba2de0 100644 --- a/osu.Game/Overlays/Chat/ChannelListItem.cs +++ b/osu.Game/Overlays/Chat/ChannelListItem.cs @@ -39,7 +39,7 @@ namespace osu.Game.Overlays.Chat { set { - FadeTo(value ? 1f : 0f, 100); + this.FadeTo(value ? 1f : 0f, 100); } } @@ -175,14 +175,14 @@ namespace osu.Game.Overlays.Chat joinedCheckmark.FadeTo(1f, transition_duration); topic.FadeTo(0.8f, transition_duration); topic.FadeColour(Color4.White, transition_duration); - FadeColour(joinedColour, transition_duration); + this.FadeColour(joinedColour, transition_duration); } else { joinedCheckmark.FadeTo(0f, transition_duration); topic.FadeTo(1f, transition_duration); topic.FadeColour(topicColour, transition_duration); - FadeColour(Color4.White, transition_duration); + this.FadeColour(Color4.White, transition_duration); } } } diff --git a/osu.Game/Overlays/Chat/ChannelSection.cs b/osu.Game/Overlays/Chat/ChannelSection.cs index cafb88b6ac..1f046aff2a 100644 --- a/osu.Game/Overlays/Chat/ChannelSection.cs +++ b/osu.Game/Overlays/Chat/ChannelSection.cs @@ -23,7 +23,7 @@ namespace osu.Game.Overlays.Chat { set { - FadeTo(value ? 1f : 0f, 100); + this.FadeTo(value ? 1f : 0f, 100); } } diff --git a/osu.Game/Overlays/Chat/ChannelSelectionOverlay.cs b/osu.Game/Overlays/Chat/ChannelSelectionOverlay.cs index 135f8f43b9..380275475b 100644 --- a/osu.Game/Overlays/Chat/ChannelSelectionOverlay.cs +++ b/osu.Game/Overlays/Chat/ChannelSelectionOverlay.cs @@ -158,10 +158,10 @@ namespace osu.Game.Overlays.Chat protected override void PopIn() { - if (Alpha == 0) MoveToY(DrawHeight); + if (Alpha == 0) this.MoveToY(DrawHeight); - FadeIn(transition_duration, EasingTypes.OutQuint); - MoveToY(0, transition_duration, EasingTypes.OutQuint); + this.FadeIn(transition_duration, EasingTypes.OutQuint); + this.MoveToY(0, transition_duration, EasingTypes.OutQuint); search.HoldFocus = true; base.PopIn(); @@ -169,8 +169,8 @@ namespace osu.Game.Overlays.Chat protected override void PopOut() { - FadeOut(transition_duration, EasingTypes.InSine); - MoveToY(DrawHeight, transition_duration, EasingTypes.InSine); + this.FadeOut(transition_duration, EasingTypes.InSine); + this.MoveToY(DrawHeight, transition_duration, EasingTypes.InSine); search.HoldFocus = false; base.PopOut(); diff --git a/osu.Game/Overlays/Chat/ChatTabControl.cs b/osu.Game/Overlays/Chat/ChatTabControl.cs index 92147db57f..cb85bdb0c9 100644 --- a/osu.Game/Overlays/Chat/ChatTabControl.cs +++ b/osu.Game/Overlays/Chat/ChatTabControl.cs @@ -86,7 +86,7 @@ namespace osu.Game.Overlays.Chat private void fadeActive() { - ResizeTo(new Vector2(Width, 1.1f), transition_length, EasingTypes.OutQuint); + this.ResizeTo(new Vector2(Width, 1.1f), transition_length, EasingTypes.OutQuint); box.FadeColour(backgroundActive, transition_length, EasingTypes.OutQuint); highlightBox.FadeIn(transition_length, EasingTypes.OutQuint); @@ -97,7 +97,7 @@ namespace osu.Game.Overlays.Chat private void fadeInactive() { - ResizeTo(new Vector2(Width, 1), transition_length, EasingTypes.OutQuint); + this.ResizeTo(new Vector2(Width, 1), transition_length, EasingTypes.OutQuint); box.FadeColour(backgroundInactive, transition_length, EasingTypes.OutQuint); highlightBox.FadeOut(transition_length, EasingTypes.OutQuint); diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 700889ed26..a6bd8a47e6 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -235,8 +235,8 @@ namespace osu.Game.Overlays protected override void PopIn() { - MoveToY(0, transition_length, EasingTypes.OutQuint); - FadeIn(transition_length, EasingTypes.OutQuint); + this.MoveToY(0, transition_length, EasingTypes.OutQuint); + this.FadeIn(transition_length, EasingTypes.OutQuint); inputTextBox.HoldFocus = true; base.PopIn(); @@ -244,8 +244,8 @@ namespace osu.Game.Overlays protected override void PopOut() { - MoveToY(Height, transition_length, EasingTypes.InSine); - FadeOut(transition_length, EasingTypes.InSine); + this.MoveToY(Height, transition_length, EasingTypes.InSine); + this.FadeOut(transition_length, EasingTypes.InSine); inputTextBox.HoldFocus = false; base.PopOut(); diff --git a/osu.Game/Overlays/DialogOverlay.cs b/osu.Game/Overlays/DialogOverlay.cs index f1a6bc1681..71015bf810 100644 --- a/osu.Game/Overlays/DialogOverlay.cs +++ b/osu.Game/Overlays/DialogOverlay.cs @@ -45,13 +45,13 @@ namespace osu.Game.Overlays protected override void PopIn() { base.PopIn(); - FadeIn(PopupDialog.ENTER_DURATION, EasingTypes.OutQuint); + this.FadeIn(PopupDialog.ENTER_DURATION, EasingTypes.OutQuint); } protected override void PopOut() { base.PopOut(); - FadeOut(PopupDialog.EXIT_DURATION, EasingTypes.InSine); + this.FadeOut(PopupDialog.EXIT_DURATION, EasingTypes.InSine); } public DialogOverlay() diff --git a/osu.Game/Overlays/Direct/DirectGridPanel.cs b/osu.Game/Overlays/Direct/DirectGridPanel.cs index 3c464af05d..cc7d57e04b 100644 --- a/osu.Game/Overlays/Direct/DirectGridPanel.cs +++ b/osu.Game/Overlays/Direct/DirectGridPanel.cs @@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Direct { base.LoadComplete(); - FadeInFromZero(200, EasingTypes.Out); + this.FadeInFromZero(200, EasingTypes.Out); bottomPanel.LayoutDuration = 200; bottomPanel.LayoutEasing = EasingTypes.Out; bottomPanel.Origin = Anchor.BottomLeft; diff --git a/osu.Game/Overlays/Direct/DirectListPanel.cs b/osu.Game/Overlays/Direct/DirectListPanel.cs index f693998563..1b36798639 100644 --- a/osu.Game/Overlays/Direct/DirectListPanel.cs +++ b/osu.Game/Overlays/Direct/DirectListPanel.cs @@ -43,7 +43,7 @@ namespace osu.Game.Overlays.Direct { base.LoadComplete(); - FadeInFromZero(200, EasingTypes.Out); + this.FadeInFromZero(200, EasingTypes.Out); } [BackgroundDependencyLoader] diff --git a/osu.Game/Overlays/DragBar.cs b/osu.Game/Overlays/DragBar.cs index 89bb81c70b..2ae017c592 100644 --- a/osu.Game/Overlays/DragBar.cs +++ b/osu.Game/Overlays/DragBar.cs @@ -75,7 +75,7 @@ namespace osu.Game.Overlays private void updatePosition(float position, bool easing = true) { position = MathHelper.Clamp(position, 0, 1); - Fill.TransformTo(position, easing ? 200 : 0, EasingTypes.OutQuint, new TransformSeek()); + Fill.TransformTo(position, easing ? 200 : 0, EasingTypes.OutQuint, new TransformSeek(this)); } protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) @@ -100,6 +100,10 @@ namespace osu.Game.Overlays private class TransformSeek : TransformFloat { + public TransformSeek(Drawable target) : base(target) + { + } + public override void Apply(Drawable d) => d.Width = CurrentValue; public override void ReadIntoStartValue(Drawable d) => StartValue = d.Width; } diff --git a/osu.Game/Overlays/LoginOverlay.cs b/osu.Game/Overlays/LoginOverlay.cs index 790530342f..3a3bb362d2 100644 --- a/osu.Game/Overlays/LoginOverlay.cs +++ b/osu.Game/Overlays/LoginOverlay.cs @@ -66,7 +66,7 @@ namespace osu.Game.Overlays base.PopIn(); settingsSection.Bounding = true; - FadeIn(transition_time, EasingTypes.OutQuint); + this.FadeIn(transition_time, EasingTypes.OutQuint); InputManager.ChangeFocus(settingsSection); } @@ -76,7 +76,7 @@ namespace osu.Game.Overlays base.PopOut(); settingsSection.Bounding = false; - FadeOut(transition_time); + this.FadeOut(transition_time); } } } diff --git a/osu.Game/Overlays/MedalOverlay.cs b/osu.Game/Overlays/MedalOverlay.cs index 5f85474ede..fce4604d9d 100644 --- a/osu.Game/Overlays/MedalOverlay.cs +++ b/osu.Game/Overlays/MedalOverlay.cs @@ -194,16 +194,13 @@ namespace osu.Game.Overlays { base.PopIn(); - FadeIn(200); + this.FadeIn(200); background.FlashColour(Color4.White.Opacity(0.25f), 400); getSample.Play(); - using (innerSpin.BeginLoopedSequence()) - innerSpin.RotateTo(360, 20000); - - using (outerSpin.BeginLoopedSequence()) - outerSpin.RotateTo(360, 40000); + innerSpin.Spin(20000); + outerSpin.Spin(40000); using (BeginDelayedSequence(200, true)) { @@ -233,7 +230,7 @@ namespace osu.Game.Overlays protected override void PopOut() { base.PopOut(); - FadeOut(200); + this.FadeOut(200); } private void dismiss() @@ -295,8 +292,8 @@ namespace osu.Game.Overlays Radius = 5, }; - MoveTo(positionForOffset(DISC_SIZE / 2 + 200), 500); - FadeOut(500); + this.MoveTo(positionForOffset(DISC_SIZE / 2 + 200), 500); + this.FadeOut(500); Expire(); } } diff --git a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs index 7d7ffbd12a..bba58e1a26 100644 --- a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs +++ b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs @@ -154,16 +154,16 @@ namespace osu.Game.Overlays.MedalSplash medalContainer.ScaleTo(1); medalContainer.Show(); - ScaleTo(scale_when_unlocked, duration, EasingTypes.OutExpo); - MoveToY(MedalOverlay.DISC_SIZE / 2 - 30, duration, EasingTypes.OutExpo); + 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.ScaleTo(1); medalContainer.Show(); - ScaleTo(scale_when_full, duration, EasingTypes.OutExpo); - MoveToY(MedalOverlay.DISC_SIZE / 2 - 60, duration, EasingTypes.OutExpo); + this.ScaleTo(scale_when_full, duration, EasingTypes.OutExpo); + this.MoveToY(MedalOverlay.DISC_SIZE / 2 - 60, duration, EasingTypes.OutExpo); name.FadeInFromZero(duration + 100); description.FadeInFromZero(duration * 2); break; diff --git a/osu.Game/Overlays/Music/PlaylistItem.cs b/osu.Game/Overlays/Music/PlaylistItem.cs index 69cb9c3464..de459cd0f8 100644 --- a/osu.Game/Overlays/Music/PlaylistItem.cs +++ b/osu.Game/Overlays/Music/PlaylistItem.cs @@ -144,7 +144,7 @@ namespace osu.Game.Overlays.Music matching = value; - FadeTo(matching ? 1 : 0, 200); + this.FadeTo(matching ? 1 : 0, 200); } } } diff --git a/osu.Game/Overlays/Music/PlaylistOverlay.cs b/osu.Game/Overlays/Music/PlaylistOverlay.cs index e5dc66fc75..ee5c50eb1a 100644 --- a/osu.Game/Overlays/Music/PlaylistOverlay.cs +++ b/osu.Game/Overlays/Music/PlaylistOverlay.cs @@ -105,16 +105,16 @@ namespace osu.Game.Overlays.Music filter.Search.HoldFocus = true; Schedule(() => inputManager.ChangeFocus(filter.Search)); - ResizeTo(new Vector2(1, playlist_height), transition_duration, EasingTypes.OutQuint); - FadeIn(transition_duration, EasingTypes.OutQuint); + this.ResizeTo(new Vector2(1, playlist_height), transition_duration, EasingTypes.OutQuint); + this.FadeIn(transition_duration, EasingTypes.OutQuint); } protected override void PopOut() { filter.Search.HoldFocus = false; - ResizeTo(new Vector2(1, 0), transition_duration, EasingTypes.OutQuint); - FadeOut(transition_duration); + this.ResizeTo(new Vector2(1, 0), transition_duration, EasingTypes.OutQuint); + this.FadeOut(transition_duration); } private void itemSelected(BeatmapSetInfo set) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index baf58ae26c..d30c66e03d 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -370,7 +370,7 @@ namespace osu.Game.Overlays { base.PopIn(); - FadeIn(transition_length, EasingTypes.OutQuint); + this.FadeIn(transition_length, EasingTypes.OutQuint); dragContainer.ScaleTo(1, transition_length, EasingTypes.OutElastic); } @@ -378,7 +378,7 @@ namespace osu.Game.Overlays { base.PopOut(); - FadeOut(transition_length, EasingTypes.OutQuint); + this.FadeOut(transition_length, EasingTypes.OutQuint); dragContainer.ScaleTo(0.9f, transition_length, EasingTypes.OutQuint); } diff --git a/osu.Game/Overlays/NotificationManager.cs b/osu.Game/Overlays/NotificationManager.cs index 18cb49f335..f83aeb1275 100644 --- a/osu.Game/Overlays/NotificationManager.cs +++ b/osu.Game/Overlays/NotificationManager.cs @@ -90,8 +90,8 @@ namespace osu.Game.Overlays base.PopIn(); scrollContainer.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint); - MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint); - FadeTo(1, TRANSITION_LENGTH / 2); + this.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint); + this.FadeTo(1, TRANSITION_LENGTH / 2); } private void markAllRead() @@ -105,8 +105,8 @@ namespace osu.Game.Overlays markAllRead(); - MoveToX(width, TRANSITION_LENGTH, EasingTypes.OutQuint); - FadeTo(0, TRANSITION_LENGTH / 2); + this.MoveToX(width, TRANSITION_LENGTH, EasingTypes.OutQuint); + this.FadeTo(0, TRANSITION_LENGTH / 2); } } } \ No newline at end of file diff --git a/osu.Game/Overlays/Notifications/Notification.cs b/osu.Game/Overlays/Notifications/Notification.cs index f5613d6656..4337989a13 100644 --- a/osu.Game/Overlays/Notifications/Notification.cs +++ b/osu.Game/Overlays/Notifications/Notification.cs @@ -135,7 +135,7 @@ namespace osu.Game.Overlays.Notifications protected override void LoadComplete() { base.LoadComplete(); - FadeInFromZero(200); + this.FadeInFromZero(200); NotificationContent.MoveToX(DrawSize.X); NotificationContent.MoveToX(0, 500, EasingTypes.OutQuint); } @@ -148,7 +148,7 @@ namespace osu.Game.Overlays.Notifications wasClosed = true; Closed?.Invoke(); - FadeOut(100); + this.FadeOut(100); Expire(); } @@ -181,13 +181,13 @@ namespace osu.Game.Overlays.Notifications protected override bool OnHover(InputState state) { - FadeColour(hoverColour, 200); + this.FadeColour(hoverColour, 200); return base.OnHover(state); } protected override void OnHoverLost(InputState state) { - FadeColour(OsuColour.Gray(0.2f), 200); + this.FadeColour(OsuColour.Gray(0.2f), 200); base.OnHoverLost(state); } } @@ -212,12 +212,9 @@ namespace osu.Game.Overlays.Notifications if (pulsate) { const float length = 1000; - using (pulsateLayer.BeginLoopedSequence(length / 2)) - { - pulsateLayer.FadeTo(0.4f, length, EasingTypes.In); - using (pulsateLayer.BeginDelayedSequence(length)) - pulsateLayer.FadeTo(1, length, EasingTypes.Out); - } + pulsateLayer.Loop(length / 2, + p => p.FadeTo(0.4f, length, EasingTypes.In).Then().FadeTo(1, length, EasingTypes.Out) + ); } } } diff --git a/osu.Game/Overlays/Notifications/ProgressNotification.cs b/osu.Game/Overlays/Notifications/ProgressNotification.cs index f0fa7e6da1..18ad148702 100644 --- a/osu.Game/Overlays/Notifications/ProgressNotification.cs +++ b/osu.Game/Overlays/Notifications/ProgressNotification.cs @@ -78,7 +78,7 @@ namespace osu.Game.Overlays.Notifications { case ProgressNotificationState.Completed: NotificationContent.MoveToY(-DrawSize.Y / 2, 200, EasingTypes.OutQuint); - FadeTo(0.01f, 200); //don't completely fade out or our scheduled task won't run. + this.FadeTo(0.01f, 200); //don't completely fade out or our scheduled task won't run. Delay(100); Schedule(Completed); @@ -196,7 +196,7 @@ namespace osu.Game.Overlays.Notifications set { active = value; - FadeColour(active ? colourActive : colourInactive, 100); + this.FadeColour(active ? colourActive : colourInactive, 100); } } diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index f80fef4a99..c74f4070e7 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Settings set { // probably needs a better transition. - FadeTo(value ? 1 : 0); + this.FadeTo(value ? 1 : 0); } } diff --git a/osu.Game/Overlays/Settings/SettingsSection.cs b/osu.Game/Overlays/Settings/SettingsSection.cs index 77bf87f718..68ebde6b28 100644 --- a/osu.Game/Overlays/Settings/SettingsSection.cs +++ b/osu.Game/Overlays/Settings/SettingsSection.cs @@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Settings { set { - FadeTo(value ? 1 : 0); + this.FadeTo(value ? 1 : 0); } } diff --git a/osu.Game/Overlays/Settings/SettingsSubsection.cs b/osu.Game/Overlays/Settings/SettingsSubsection.cs index 0a9f7ba5d0..ac6d2fa239 100644 --- a/osu.Game/Overlays/Settings/SettingsSubsection.cs +++ b/osu.Game/Overlays/Settings/SettingsSubsection.cs @@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Settings { set { - FadeTo(value ? 1 : 0); + this.FadeTo(value ? 1 : 0); } } diff --git a/osu.Game/Overlays/Settings/Sidebar.cs b/osu.Game/Overlays/Settings/Sidebar.cs index 44d296a079..f5ab3b301b 100644 --- a/osu.Game/Overlays/Settings/Sidebar.cs +++ b/osu.Game/Overlays/Settings/Sidebar.cs @@ -94,10 +94,10 @@ namespace osu.Game.Overlays.Settings switch (state) { default: - ResizeTo(new Vector2(DEFAULT_WIDTH, Height), 500, EasingTypes.OutQuint); + this.ResizeTo(new Vector2(DEFAULT_WIDTH, Height), 500, EasingTypes.OutQuint); break; case ExpandedState.Expanded: - ResizeTo(new Vector2(EXPANDED_WIDTH, Height), 500, EasingTypes.OutQuint); + this.ResizeTo(new Vector2(EXPANDED_WIDTH, Height), 500, EasingTypes.OutQuint); break; } } diff --git a/osu.Game/Overlays/SettingsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs index 66b15234c3..d7d45371ff 100644 --- a/osu.Game/Overlays/SettingsOverlay.cs +++ b/osu.Game/Overlays/SettingsOverlay.cs @@ -127,7 +127,7 @@ namespace osu.Game.Overlays sectionsContainer.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint); sidebar.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint); - FadeTo(1, TRANSITION_LENGTH / 2); + this.FadeTo(1, TRANSITION_LENGTH / 2); searchTextBox.HoldFocus = true; } @@ -138,7 +138,7 @@ namespace osu.Game.Overlays sectionsContainer.MoveToX(-width, TRANSITION_LENGTH, EasingTypes.OutQuint); sidebar.MoveToX(-SIDEBAR_WIDTH, TRANSITION_LENGTH, EasingTypes.OutQuint); - FadeTo(0, TRANSITION_LENGTH / 2); + this.FadeTo(0, TRANSITION_LENGTH / 2); searchTextBox.HoldFocus = false; if (searchTextBox.HasFocus) diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index a7e5f8dcc4..9070bc45ad 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -121,16 +121,16 @@ namespace osu.Game.Overlays.Toolbar protected override void PopIn() { - MoveToY(0, transition_time, EasingTypes.OutQuint); - FadeIn(transition_time / 2, EasingTypes.OutQuint); + this.MoveToY(0, transition_time, EasingTypes.OutQuint); + this.FadeIn(transition_time / 2, EasingTypes.OutQuint); } protected override void PopOut() { userArea?.LoginOverlay.Hide(); - MoveToY(-DrawSize.Y, transition_time, EasingTypes.OutQuint); - FadeOut(transition_time); + this.MoveToY(-DrawSize.Y, transition_time, EasingTypes.OutQuint); + this.FadeOut(transition_time); } } } diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs index 95906464ec..3ecf0fd83c 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs @@ -86,7 +86,7 @@ namespace osu.Game.Overlays.Toolbar public override bool HandleInput => !ruleset.Disabled; - private void disabledChanged(bool isDisabled) => FadeColour(isDisabled ? Color4.Gray : Color4.White, 300); + private void disabledChanged(bool isDisabled) => this.FadeColour(isDisabled ? Color4.Gray : Color4.White, 300); protected override void Update() { diff --git a/osu.Game/Overlays/WaveOverlayContainer.cs b/osu.Game/Overlays/WaveOverlayContainer.cs index 1bb7813d90..ce587c9ed2 100644 --- a/osu.Game/Overlays/WaveOverlayContainer.cs +++ b/osu.Game/Overlays/WaveOverlayContainer.cs @@ -137,23 +137,23 @@ namespace osu.Game.Overlays foreach (var w in wavesContainer.Children) w.State = Visibility.Visible; - FadeIn(100, EasingTypes.OutQuint); + this.FadeIn(100, EasingTypes.OutQuint); contentContainer.MoveToY(0, APPEAR_DURATION, EasingTypes.OutQuint); - FadeIn(100, EasingTypes.OutQuint); + this.FadeIn(100, EasingTypes.OutQuint); } protected override void PopOut() { base.PopOut(); - FadeOut(DISAPPEAR_DURATION, EasingTypes.InQuint); + this.FadeOut(DISAPPEAR_DURATION, EasingTypes.InQuint); contentContainer.MoveToY(DrawHeight * 2f, DISAPPEAR_DURATION, EasingTypes.In); foreach (var w in wavesContainer.Children) w.State = Visibility.Hidden; - FadeOut(DISAPPEAR_DURATION, EasingTypes.InQuint); + this.FadeOut(DISAPPEAR_DURATION, EasingTypes.InQuint); } protected override void UpdateAfterChildren() @@ -210,10 +210,10 @@ namespace osu.Game.Overlays switch (value) { case Visibility.Hidden: - MoveToY(Parent.Parent.DrawSize.Y, DISAPPEAR_DURATION, easing_hide); + this.MoveToY(Parent.Parent.DrawSize.Y, DISAPPEAR_DURATION, easing_hide); break; case Visibility.Visible: - MoveToY(FinalPosition, APPEAR_DURATION, easing_show); + this.MoveToY(FinalPosition, APPEAR_DURATION, easing_show); break; } } diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 3a82827497..ad21650f36 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -64,26 +64,26 @@ namespace osu.Game.Rulesets.Judgements { base.LoadComplete(); - FadeInFromZero(100, EasingTypes.OutQuint); + this.FadeInFromZero(100, EasingTypes.OutQuint); switch (Judgement.Result) { case HitResult.Miss: - ScaleTo(1.6f); - ScaleTo(1, 100, EasingTypes.In); + this.ScaleTo(1.6f); + this.ScaleTo(1, 100, EasingTypes.In); - MoveToOffset(new Vector2(0, 100), 800, EasingTypes.InQuint); - RotateTo(40, 800, EasingTypes.InQuint); + this.MoveToOffset(new Vector2(0, 100), 800, EasingTypes.InQuint); + this.RotateTo(40, 800, EasingTypes.InQuint); Delay(600); - FadeOut(200); + this.FadeOut(200); break; case HitResult.Hit: - ScaleTo(0.9f); - ScaleTo(1, 500, EasingTypes.OutElastic); + this.ScaleTo(0.9f); + this.ScaleTo(1, 500, EasingTypes.OutElastic); Delay(100); - FadeOut(400); + this.FadeOut(400); break; } diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 2582c68296..8580d043fe 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -7,6 +7,7 @@ using OpenTK.Graphics; using osu.Framework.Screens; using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Select; +using osu.Framework.Graphics; namespace osu.Game.Screens.Edit { diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index 8dad83bd0e..aa866574cc 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -248,23 +248,23 @@ namespace osu.Game.Screens.Menu { default: box.ScaleTo(new Vector2(0, 1), 500, EasingTypes.OutExpo); - FadeOut(500); + this.FadeOut(500); break; case 1: box.ScaleTo(new Vector2(0, 1), 400, EasingTypes.InSine); - FadeOut(800); + this.FadeOut(800); break; } break; case ButtonState.Expanded: const int expand_duration = 500; box.ScaleTo(new Vector2(1, 1), expand_duration, EasingTypes.OutExpo); - FadeIn(expand_duration / 6f); + this.FadeIn(expand_duration / 6f); break; case ButtonState.Exploded: const int explode_duration = 200; box.ScaleTo(new Vector2(2, 1), explode_duration, EasingTypes.OutExpo); - FadeOut(explode_duration / 4f * 3); + this.FadeOut(explode_duration / 4f * 3); break; } } diff --git a/osu.Game/Screens/Multiplayer/Match.cs b/osu.Game/Screens/Multiplayer/Match.cs index ec6a66062d..a0843bfcae 100644 --- a/osu.Game/Screens/Multiplayer/Match.cs +++ b/osu.Game/Screens/Multiplayer/Match.cs @@ -8,6 +8,7 @@ using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Play; using OpenTK.Graphics; using osu.Game.Screens.Select; +using osu.Framework.Graphics; namespace osu.Game.Screens.Multiplayer { diff --git a/osu.Game/Screens/Play/HUD/ComboCounter.cs b/osu.Game/Screens/Play/HUD/ComboCounter.cs index 4a9ea0fa59..a7c91bd90a 100644 --- a/osu.Game/Screens/Play/HUD/ComboCounter.cs +++ b/osu.Game/Screens/Play/HUD/ComboCounter.cs @@ -6,7 +6,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transforms; -using osu.Framework.MathUtils; using osu.Game.Graphics.Sprites; namespace osu.Game.Screens.Play.HUD @@ -130,7 +129,7 @@ namespace osu.Game.Screens.Play.HUD protected virtual void OnCountRolling(int currentValue, int newValue) { - transformRoll(new TransformComboRoll(), currentValue, newValue); + transformRoll(new TransformComboRoll(this), currentValue, newValue); } protected virtual void OnCountIncrement(int currentValue, int newValue) @@ -188,25 +187,17 @@ namespace osu.Game.Screens.Play.HUD private void transformRoll(TransformComboRoll transform, int currentValue, int newValue) { - TransformTo(newValue, getProportionalDuration(currentValue, newValue), RollingEasing, new TransformComboRoll()); + this.TransformTo(newValue, getProportionalDuration(currentValue, newValue), RollingEasing, new TransformComboRoll(this)); } - protected class TransformComboRoll : Transform + protected class TransformComboRoll : TransformInt { - public virtual int CurrentValue + public TransformComboRoll(ComboCounter target) : base(target) { - get - { - double time = Time?.Current ?? 0; - if (time < StartTime) return StartValue; - if (time >= EndTime) return EndValue; - - return (int)Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing); - } } - public override void Apply(Drawable d) => ((ComboCounter)d).DisplayedCount = CurrentValue; - public override void ReadIntoStartValue(Drawable d) => StartValue = ((ComboCounter)d).DisplayedCount; + public override void Apply(ComboCounter d) => d.DisplayedCount = CurrentValue; + public override void ReadIntoStartValue(ComboCounter d) => StartValue = d.DisplayedCount; } protected abstract void OnDisplayedCountRolling(int currentValue, int newValue); diff --git a/osu.Game/Screens/Play/HUD/ComboResultCounter.cs b/osu.Game/Screens/Play/HUD/ComboResultCounter.cs index e658658306..1686b6174d 100644 --- a/osu.Game/Screens/Play/HUD/ComboResultCounter.cs +++ b/osu.Game/Screens/Play/HUD/ComboResultCounter.cs @@ -1,10 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using osu.Framework.Graphics; -using osu.Framework.Graphics.Transforms; -using osu.Framework.MathUtils; using osu.Game.Graphics.UserInterface; namespace osu.Game.Screens.Play.HUD diff --git a/osu.Game/Screens/Play/HUD/StandardComboCounter.cs b/osu.Game/Screens/Play/HUD/StandardComboCounter.cs index 525e52d207..04fe78116e 100644 --- a/osu.Game/Screens/Play/HUD/StandardComboCounter.cs +++ b/osu.Game/Screens/Play/HUD/StandardComboCounter.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; +using osu.Framework.Graphics; namespace osu.Game.Screens.Play.HUD { diff --git a/osu.Game/Screens/Play/KeyCounterCollection.cs b/osu.Game/Screens/Play/KeyCounterCollection.cs index b4b2691390..01e20fdbd7 100644 --- a/osu.Game/Screens/Play/KeyCounterCollection.cs +++ b/osu.Game/Screens/Play/KeyCounterCollection.cs @@ -44,7 +44,7 @@ namespace osu.Game.Screens.Play private void load(OsuConfigManager config) { showKeyCounter = config.GetBindable(OsuSetting.KeyOverlay); - showKeyCounter.ValueChanged += keyCounterVisibility => FadeTo(keyCounterVisibility ? 1 : 0, duration); + showKeyCounter.ValueChanged += keyCounterVisibility => this.FadeTo(keyCounterVisibility ? 1 : 0, duration); showKeyCounter.TriggerChange(); } diff --git a/osu.Game/Screens/Play/MenuOverlay.cs b/osu.Game/Screens/Play/MenuOverlay.cs index aedbffbab9..ee08bcc031 100644 --- a/osu.Game/Screens/Play/MenuOverlay.cs +++ b/osu.Game/Screens/Play/MenuOverlay.cs @@ -76,8 +76,8 @@ namespace osu.Game.Screens.Play public override bool HandleInput => State == Visibility.Visible; - protected override void PopIn() => FadeIn(transition_duration, EasingTypes.In); - protected override void PopOut() => FadeOut(transition_duration, EasingTypes.In); + protected override void PopIn() => this.FadeIn(transition_duration, EasingTypes.In); + protected override void PopOut() => this.FadeOut(transition_duration, EasingTypes.In); // Don't let mouse down events through the overlay or people can click circles while paused. protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true; diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index f2ed378e7c..35502c2d4a 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -143,7 +143,7 @@ namespace osu.Game.Screens.Play protected override bool OnExiting(Screen next) { Content.ScaleTo(0.7f, 150, EasingTypes.InQuint); - FadeOut(150); + this.FadeOut(150); return base.OnExiting(next); } diff --git a/osu.Game/Screens/Play/SkipButton.cs b/osu.Game/Screens/Play/SkipButton.cs index b0e3de0ea4..6637680c15 100644 --- a/osu.Game/Screens/Play/SkipButton.cs +++ b/osu.Game/Screens/Play/SkipButton.cs @@ -100,9 +100,9 @@ namespace osu.Game.Screens.Play return; } - FadeInFromZero(fade_time); + this.FadeInFromZero(fade_time); using (BeginAbsoluteSequence(beginFadeTime)) - FadeOut(fade_time); + this.FadeOut(fade_time); button.Action = () => AudioClock?.Seek(startTime - skip_required_cutoff - fade_time); @@ -154,14 +154,14 @@ namespace osu.Game.Screens.Play { case Visibility.Visible: if (lastState == Visibility.Hidden) - FadeIn(500, EasingTypes.OutExpo); + this.FadeIn(500, EasingTypes.OutExpo); if (!IsHovered) using (BeginDelayedSequence(1000)) scheduledHide = Schedule(() => State = Visibility.Hidden); break; case Visibility.Hidden: - FadeOut(1000, EasingTypes.OutExpo); + this.FadeOut(1000, EasingTypes.OutExpo); break; } } diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index e5b18292ab..88c30f8c1a 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -123,18 +123,18 @@ namespace osu.Game.Screens.Play private void updateBarVisibility() { bar.FadeTo(allowSeeking ? 1 : 0, transition_duration, EasingTypes.In); - MoveTo(new Vector2(0, allowSeeking ? 0 : bottom_bar_height), transition_duration, EasingTypes.In); + this.MoveTo(new Vector2(0, allowSeeking ? 0 : bottom_bar_height), transition_duration, EasingTypes.In); } protected override void PopIn() { updateBarVisibility(); - FadeIn(500, EasingTypes.OutQuint); + this.FadeIn(500, EasingTypes.OutQuint); } protected override void PopOut() { - FadeOut(100); + this.FadeOut(100); } protected override void Update() diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 42f9598096..72f4a215d0 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -51,14 +51,14 @@ namespace osu.Game.Screens.Select protected override void PopIn() { - MoveToX(0, 800, EasingTypes.OutQuint); - RotateTo(0, 800, EasingTypes.OutQuint); + this.MoveToX(0, 800, EasingTypes.OutQuint); + this.RotateTo(0, 800, EasingTypes.OutQuint); } protected override void PopOut() { - MoveToX(-100, 800, EasingTypes.InQuint); - RotateTo(10, 800, EasingTypes.InQuint); + this.MoveToX(-100, 800, EasingTypes.InQuint); + this.RotateTo(10, 800, EasingTypes.InQuint); } public void UpdateBeatmap(WorkingBeatmap beatmap) @@ -84,7 +84,7 @@ namespace osu.Game.Screens.Select Shear = -Shear, OnLoadComplete = d => { - FadeIn(250); + this.FadeIn(250); lastContainer?.FadeOut(250); lastContainer?.Expire(); diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 48de4c2d3a..7a211e406c 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -61,7 +61,7 @@ namespace osu.Game.Screens.Select.Leaderboards nameLabel.MoveToX(150); break; case Visibility.Visible: - FadeIn(200); + this.FadeIn(200); content.MoveToY(0, 800, EasingTypes.OutQuint); Delay(100, true); diff --git a/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs b/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs index 6345807ea3..4b9a85f7f8 100644 --- a/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs +++ b/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs @@ -29,7 +29,7 @@ namespace osu.Game.Screens.Select.Options { base.PopIn(); - FadeIn(transition_duration, EasingTypes.OutQuint); + this.FadeIn(transition_duration, EasingTypes.OutQuint); if (buttonsContainer.Position.X == 1 || Alpha == 0) buttonsContainer.MoveToX(x_position - x_movement); @@ -49,7 +49,7 @@ namespace osu.Game.Screens.Select.Options buttonsContainer.MoveToX(x_position + x_movement, transition_duration, EasingTypes.InSine); buttonsContainer.TransformSpacingTo(new Vector2(200f, 0f), transition_duration, EasingTypes.InSine); - FadeOut(transition_duration, EasingTypes.InQuint); + this.FadeOut(transition_duration, EasingTypes.InQuint); } public BeatmapOptionsOverlay() diff --git a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs index 30f109e598..171b404cd9 100644 --- a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs +++ b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs @@ -297,7 +297,7 @@ namespace osu.Game.Screens.Tournament } } - private void speedTo(float value, double duration = 0, EasingTypes easing = EasingTypes.None) => TransformTo(value, duration, easing, new TransformScrollSpeed()); + private void speedTo(float value, double duration = 0, EasingTypes easing = EasingTypes.None) => this.TransformTo(value, duration, easing, new TransformScrollSpeed(this)); private enum ScrollState { @@ -308,10 +308,14 @@ namespace osu.Game.Screens.Tournament Scrolling } - public class TransformScrollSpeed : TransformFloat + public class TransformScrollSpeed : TransformFloat { - public override void Apply(Drawable d) => ((ScrollingTeamContainer)d).speed = CurrentValue; - public override void ReadIntoStartValue(Drawable d) => StartValue = ((ScrollingTeamContainer)d).speed; + public TransformScrollSpeed(ScrollingTeamContainer target) : base(target) + { + } + + public override void Apply(ScrollingTeamContainer d) => d.speed = CurrentValue; + public override void ReadIntoStartValue(ScrollingTeamContainer d) => StartValue = d.speed; } public class ScrollingTeam : Container diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index 881aaf2e07..46aadb9580 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -183,13 +183,13 @@ namespace osu.Game.Users { statusBar.ResizeHeightTo(0f, transition_duration, EasingTypes.OutQuint); statusBar.FadeOut(transition_duration, EasingTypes.OutQuint); - ResizeHeightTo(height - status_height, transition_duration, EasingTypes.OutQuint); + this.ResizeHeightTo(height - status_height, transition_duration, EasingTypes.OutQuint); } else { statusBar.ResizeHeightTo(status_height, transition_duration, EasingTypes.OutQuint); statusBar.FadeIn(transition_duration, EasingTypes.OutQuint); - ResizeHeightTo(height, transition_duration, EasingTypes.OutQuint); + this.ResizeHeightTo(height, transition_duration, EasingTypes.OutQuint); statusBg.FadeColour(status.GetAppropriateColour(colours), 500, EasingTypes.OutQuint); statusMessage.Text = status.Message;