From 34ba3129a345ceb94d0546bbb745b9a5825d216a Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 27 Feb 2017 20:44:27 -0400 Subject: [PATCH] Removed background triangles --- osu.Game/Overlays/Dialog/PopupDialog.cs | 91 ------------------------- 1 file changed, 91 deletions(-) diff --git a/osu.Game/Overlays/Dialog/PopupDialog.cs b/osu.Game/Overlays/Dialog/PopupDialog.cs index 401fc79b00..06ecb9236c 100644 --- a/osu.Game/Overlays/Dialog/PopupDialog.cs +++ b/osu.Game/Overlays/Dialog/PopupDialog.cs @@ -25,7 +25,6 @@ namespace osu.Game.Overlays.Dialog private readonly Vector2 ring_minified_size = new Vector2(20f); private readonly Vector2 buttons_spacing = new Vector2(0f, 50f); - private PopupDialogTriangles triangles; private Container content, ring; private FlowContainer buttonsContainer; private TextAwesome iconText; @@ -98,7 +97,6 @@ namespace osu.Game.Overlays.Dialog ring.ResizeTo(ring_minified_size); } - triangles.SlideIn(); content.FadeIn(enter_duration, EasingTypes.OutQuint); ring.ResizeTo(ring_size, enter_duration, EasingTypes.OutQuint); buttonsContainer.TransformSpacingTo(Vector2.Zero, enter_duration, EasingTypes.OutQuint); @@ -107,7 +105,6 @@ namespace osu.Game.Overlays.Dialog protected override void PopOut() { - triangles.SlideOut(); content.FadeOut(exit_duration, EasingTypes.InSine); } @@ -115,13 +112,6 @@ namespace osu.Game.Overlays.Dialog { Children = new Drawable[] { - triangles = new PopupDialogTriangles - { - RelativeSizeAxes = Axes.Both, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, - Width = 0.5f, - }, content = new Container { RelativeSizeAxes = Axes.Both, @@ -233,85 +223,4 @@ namespace osu.Game.Overlays.Dialog }; } } - - class PopupDialogTriangles : Triangles - { - private const float transition_duration = 500; - private const float triangle_normal_speed = 20000; - private const float triangle_moving_speed = 100; - private float triangleMoveSpeed; - - private Color4[] colours; - - protected override float SpawnRatio => spawnRatio; - private float spawnRatio = 0f; - - protected override Color4 GetTriangleShade() => colours[RNG.Next(0, colours.Length - 1)]; - - [BackgroundDependencyLoader] - private void load(OsuColour colour) - { - colours = new Color4[] - { - colour.BlueLight, - colour.Blue, - colour.PinkLight, - colour.Pink, - colour.YellowLight, - colour.Yellow, - colour.PurpleLight, - colour.Purple, - }; - } - - protected override void Update() - { - base.Update(); - foreach (Drawable d in Children) - d.Position -= new Vector2(0, (float)(d.Scale.X * (Time.Elapsed / triangleMoveSpeed))); - } - - public void SlideIn() - { - triangleMoveSpeed = triangle_moving_speed; - TransformFloatTo(spawnRatio, 1f, transition_duration, EasingTypes.None, new TransformFloatSpawnRatio()); - TransformFloatTo(triangleMoveSpeed, triangle_normal_speed, transition_duration, EasingTypes.InExpo, new TransformFloatSpeed()); - } - - public void SlideOut() - { - TransformFloatTo(spawnRatio, 0f, transition_duration, EasingTypes.None, new TransformFloatSpawnRatio()); - TransformFloatTo(triangleMoveSpeed, triangle_moving_speed, transition_duration, EasingTypes.OutExpo, new TransformFloatSpeed()); - } - - class TransformFloatSpeed : TransformFloat - { - public override void Apply(Drawable d) - { - base.Apply(d); - PopupDialogTriangles t = d as PopupDialogTriangles; - t.triangleMoveSpeed = CurrentValue; - } - } - - class TransformFloatSpawnRatio : TransformFloat - { - public override void Apply(Drawable d) - { - base.Apply(d); - PopupDialogTriangles t = d as PopupDialogTriangles; - t.spawnRatio = CurrentValue; - } - } - - protected override void LoadComplete() - { - // override so the triangles don't do the initial fill - } - - public PopupDialogTriangles() - { - TriangleScale = 2f; - } - } } \ No newline at end of file