diff --git a/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs b/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs index c0c17cd50e..5665bf859a 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs @@ -30,7 +30,9 @@ namespace osu.Desktop.VisualTests.Tests Anchor = Anchor.Centre }; Add(mc); - AddToggleStep(@"Show", state => mc.State = state ? Visibility.Visible : Visibility.Hidden); + + AddToggleStep(@"toggle visibility", state => mc.State = state ? Visibility.Visible : Visibility.Hidden); + AddStep(@"show", () => mc.State = Visibility.Visible); } } } diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 377fc8c0ee..7d7c61b69a 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -31,7 +31,7 @@ namespace osu.Game.Configuration Set(OsuConfig.MouseDisableWheel, false); Set(OsuConfig.SnakingInSliders, true); - Set(OsuConfig.SnakingOutSliders, false); + Set(OsuConfig.SnakingOutSliders, true); Set(OsuConfig.MenuParallax, true); diff --git a/osu.Game/Overlays/DragBar.cs b/osu.Game/Overlays/DragBar.cs index 9244baba9e..9bc4d5834a 100644 --- a/osu.Game/Overlays/DragBar.cs +++ b/osu.Game/Overlays/DragBar.cs @@ -5,7 +5,9 @@ using System; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Transforms; using osu.Framework.Input; +using OpenTK; namespace osu.Game.Overlays { @@ -17,7 +19,7 @@ namespace osu.Game.Overlays public Action SeekRequested; private bool isDragging; - private bool enabled; + private bool enabled = true; public bool IsEnabled { get { return enabled; } @@ -56,7 +58,7 @@ namespace osu.Game.Overlays { if (isDragging || !IsEnabled) return; - FillContainer.Width = position; + updatePosition(position); } private void seek(InputState state) @@ -64,7 +66,13 @@ namespace osu.Game.Overlays if (!IsEnabled) return; float seekLocation = state.Mouse.Position.X / DrawWidth; SeekRequested?.Invoke(seekLocation); - FillContainer.Width = seekLocation; + updatePosition(seekLocation); + } + + private void updatePosition(float position) + { + position = MathHelper.Clamp(position, 0, 1); + FillContainer.TransformTo(FillContainer.Width, position, 100, EasingTypes.OutQuint, new TransformWidth()); } protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) @@ -86,5 +94,14 @@ namespace osu.Game.Overlays isDragging = false; return true; } + + private class TransformWidth : TransformFloat + { + public override void Apply(Drawable d) + { + base.Apply(d); + d.Width = CurrentValue; + } + } } } diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 9f3eeb47a0..c91618f959 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -30,7 +30,7 @@ namespace osu.Game.Overlays { private Drawable currentBackground; private DragBar progress; - private TextAwesome playButton; + private Button playButton; private SpriteText title, artist; private List playList; @@ -46,6 +46,8 @@ namespace osu.Game.Overlays private Container dragContainer; + private const float bottom_black_area_height = 50; + public MusicController() { Width = 400; @@ -115,83 +117,47 @@ namespace osu.Game.Overlays Text = @"Nothing to play", Font = @"Exo2.0-BoldItalic" }, - new ClickableContainer + new FillFlowContainer