From fb3d5a3b7904cd1a8e1a6b4516bb44d0da1b048e Mon Sep 17 00:00:00 2001 From: stanriders Date: Sun, 27 Nov 2016 07:18:56 +0300 Subject: [PATCH] One more --- osu.Game/Graphics/UserInterface/BackButton.cs | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/BackButton.cs b/osu.Game/Graphics/UserInterface/BackButton.cs index 35d07fdc6a..7cba17bf91 100644 --- a/osu.Game/Graphics/UserInterface/BackButton.cs +++ b/osu.Game/Graphics/UserInterface/BackButton.cs @@ -19,24 +19,17 @@ namespace osu.Game.Graphics.UserInterface private Container leftContainer; private Container rightContainer; - public Vector2 ExtendLength; - public Vector2 InitialExtendLength; + public Vector2 ExtendLength = new Vector2(60, 0); + public Vector2 InitialExtendLength = new Vector2(40, 0); private Color4 colorBright = new Color4(238, 51, 153, 255); private Color4 colorDark = new Color4(195, 40, 140, 255); - private const double transformTime = 300.0; - private const int pulseLength = 250; // FIXME: remove when bpm-based pulsing will be possible + private const double transform_time = 300.0; + private const int pulse_length = 250; public BackButton() { - // [ should be set or should be relative? - InitialExtendLength = new Vector2(40, 0); - ExtendLength = new Vector2(60, 0); - Width = 80; - //Height = 40; - // ] should be set or should be relative? - Children = new Drawable[] { leftContainer = new Container @@ -90,11 +83,11 @@ namespace osu.Game.Graphics.UserInterface { icon.ClearTransformations(); - rightContainer.MoveTo(Position + ExtendLength, transformTime, EasingTypes.OutElastic); - leftContainer.ResizeTo(new Vector2(ExtendLength.X, 1.0f), transformTime, EasingTypes.OutElastic); + rightContainer.MoveTo(Position + ExtendLength, transform_time, EasingTypes.OutElastic); + leftContainer.ResizeTo(new Vector2(ExtendLength.X, 1.0f), transform_time, EasingTypes.OutElastic); int duration = 0; //(int)(Game.Audio.BeatLength / 2); - if (duration == 0) duration = pulseLength; + if (duration == 0) duration = pulse_length; double offset = 0; //(1 - Game.Audio.SyncBeatProgress) * duration; double startTime = Time.Current + offset; @@ -118,11 +111,11 @@ namespace osu.Game.Graphics.UserInterface { icon.ClearTransformations(); - rightContainer.MoveTo(Position + InitialExtendLength, transformTime, EasingTypes.OutElastic); - leftContainer.ResizeTo(new Vector2(InitialExtendLength.X, 1.0f), transformTime, EasingTypes.OutElastic); + rightContainer.MoveTo(Position + InitialExtendLength, transform_time, EasingTypes.OutElastic); + leftContainer.ResizeTo(new Vector2(InitialExtendLength.X, 1.0f), transform_time, EasingTypes.OutElastic); int duration = 0; //(int)(Game.Audio.BeatLength / 2); - if (duration == 0) duration = pulseLength * 2; + if (duration == 0) duration = pulse_length * 2; double offset = 0; //(1 - Game.Audio.SyncBeatProgress) * duration; double startTime = Time.Current + offset;