From fba72b9a9e6b9293fabd843192d76aa367fb8792 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Apr 2017 09:28:13 +0900 Subject: [PATCH 1/7] Snaking out on by default. --- osu.Game/Configuration/OsuConfigManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); From 6d001d8517fe869f95458a15421895f013503367 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Apr 2017 09:40:06 +0900 Subject: [PATCH 2/7] Don't recommend property code style changes for now. --- osu.sln.DotSettings | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index a92832ec8c..1caf41230c 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -5,6 +5,7 @@ True ExplicitlyExcluded SOLUTION + HINT WARNING WARNING WARNING @@ -620,6 +621,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-frame <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> @@ -628,6 +630,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-frame <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + C:\Users\Dean\AppData\Local\JetBrains\Transient\ReSharperPlatformVs15\v08_16620fcf\SolutionCaches True True True From c67f23a81d9baeefb5bb55ed05e4d55174a071d3 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 7 Apr 2017 12:02:30 +0900 Subject: [PATCH 3/7] Fix unneeded key. --- osu.sln.DotSettings | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 1caf41230c..bc2c347d0c 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -630,7 +630,6 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-frame <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - C:\Users\Dean\AppData\Local\JetBrains\Transient\ReSharperPlatformVs15\v08_16620fcf\SolutionCaches True True True From bc4e0bfa8b2ceebeec41675692a18b861f4aeec1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Apr 2017 09:57:34 +0900 Subject: [PATCH 4/7] Make DragBar animate seeks. --- osu.Game/Overlays/DragBar.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/DragBar.cs b/osu.Game/Overlays/DragBar.cs index a9cf735171..dc79b1f094 100644 --- a/osu.Game/Overlays/DragBar.cs +++ b/osu.Game/Overlays/DragBar.cs @@ -5,6 +5,7 @@ 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; namespace osu.Game.Overlays @@ -48,7 +49,7 @@ namespace osu.Game.Overlays { if (isDragging || !IsEnabled) return; - fill.Width = position; + updatePosition(position); } private void seek(InputState state) @@ -56,7 +57,12 @@ namespace osu.Game.Overlays if (!IsEnabled) return; float seekLocation = state.Mouse.Position.X / DrawWidth; SeekRequested?.Invoke(seekLocation); - fill.Width = seekLocation; + updatePosition(seekLocation); + } + + private void updatePosition(float position) + { + fill.TransformTo(fill.Width, position, 100, EasingTypes.OutQuint, new TransformWidth()); } protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) @@ -78,5 +84,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; + } + } } } From 7c9f30c2885df26f7c9fdec4cef7e546da43af84 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Apr 2017 11:02:37 +0900 Subject: [PATCH 5/7] MusicController regression fixes. --- osu.Game/Overlays/DragBar.cs | 4 +++- osu.Game/Overlays/MusicController.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/DragBar.cs b/osu.Game/Overlays/DragBar.cs index dc79b1f094..251aed1ee4 100644 --- a/osu.Game/Overlays/DragBar.cs +++ b/osu.Game/Overlays/DragBar.cs @@ -7,6 +7,7 @@ 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 +18,7 @@ namespace osu.Game.Overlays public Action SeekRequested; private bool isDragging; - private bool enabled; + private bool enabled = true; public bool IsEnabled { get { return enabled; } @@ -62,6 +63,7 @@ namespace osu.Game.Overlays private void updatePosition(float position) { + position = MathHelper.Clamp(position, 0, 1); fill.TransformTo(fill.Width, position, 100, EasingTypes.OutQuint, new TransformWidth()); } diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 9f3eeb47a0..2fc6922dcf 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -237,7 +237,7 @@ namespace osu.Game.Overlays if (current?.TrackLoaded ?? false) { - progress.UpdatePosition((float)(current.Track.CurrentTime / current.Track.Length)); + progress.UpdatePosition(current.Track.Length == 0 ? 0 : (float)(current.Track.CurrentTime / current.Track.Length)); playButton.Icon = current.Track.IsRunning ? FontAwesome.fa_pause_circle_o : FontAwesome.fa_play_circle_o; if (current.Track.HasCompleted && !current.Track.Looping) next(); From fa28e7bdc30b0f41dc4f05b9bbfbce113b7b4df8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Apr 2017 13:04:57 +0900 Subject: [PATCH 6/7] Improve clickability and visuals of MusicController buttons. --- .../Tests/TestCaseMusicController.cs | 4 +- osu.Game/Overlays/MusicController.cs | 185 +++++++++++------- 2 files changed, 121 insertions(+), 68 deletions(-) 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/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 2fc6922dcf..fb319d46d5 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,46 @@ namespace osu.Game.Overlays Text = @"Nothing to play", Font = @"Exo2.0-BoldItalic" }, - new ClickableContainer + new FillFlowContainer