From 18bb61897fc5f58cea392572047ae100cf5fa0a2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 9 Feb 2017 12:46:53 +0900 Subject: [PATCH 1/5] Update overlay containers in lines with framework changes. Allows closing the MusicController using escape. --- osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs | 2 ++ osu.Game/Overlays/MusicController.cs | 4 ---- osu.Game/Overlays/Pause/PauseOverlay.cs | 3 +++ osu.Game/Overlays/Toolbar/Toolbar.cs | 4 ++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 0e40127d3f..5f14e27441 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -19,6 +19,8 @@ namespace osu.Game.Graphics.UserInterface.Volume { private VolumeMeter volumeMeterMaster; + protected override bool HideOnEscape => false; + private void volumeChanged(object sender, EventArgs e) { Show(); diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 034278a2ef..521cddd7e2 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -374,10 +374,6 @@ namespace osu.Game.Overlays base.Dispose(isDisposing); } - protected override bool OnClick(InputState state) => true; - - protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true; - //placeholder for toggling protected override void PopIn() => FadeIn(100); diff --git a/osu.Game/Overlays/Pause/PauseOverlay.cs b/osu.Game/Overlays/Pause/PauseOverlay.cs index 847b3fe55d..43365a610d 100644 --- a/osu.Game/Overlays/Pause/PauseOverlay.cs +++ b/osu.Game/Overlays/Pause/PauseOverlay.cs @@ -22,6 +22,8 @@ namespace osu.Game.Overlays.Pause private const int button_height = 70; private const float background_alpha = 0.75f; + protected override bool HideOnEscape => false; + public Action OnResume; public Action OnRetry; public Action OnQuit; @@ -83,6 +85,7 @@ namespace osu.Game.Overlays.Pause resume(); return true; } + return base.OnKeyDown(state, args); } diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index 1b6abb475c..503a3e0bf5 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -24,6 +24,10 @@ namespace osu.Game.Overlays.Toolbar private ToolbarModeSelector modeSelector; private ToolbarUserArea userArea; + protected override bool HideOnEscape => false; + + protected override bool BlockPassThroughInput => false; + private const int transition_time = 500; private const float alpha_hovering = 0.8f; From 581ec765fb07d99e2f38ca18eb6d4e7885d2f13a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 9 Feb 2017 12:51:56 +0900 Subject: [PATCH 2/5] Improve transitions of MusicController. --- osu.Game/Overlays/MusicController.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 521cddd7e2..eaf40294a5 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) transition_length7-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -85,6 +85,8 @@ namespace osu.Game.Overlays { dragContainer = new Container { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, Masking = true, CornerRadius = 5, EdgeEffect = new EdgeEffect @@ -374,10 +376,19 @@ namespace osu.Game.Overlays base.Dispose(isDisposing); } - //placeholder for toggling - protected override void PopIn() => FadeIn(100); + const float transition_length = 800; - protected override void PopOut() => FadeOut(100); + protected override void PopIn() + { + FadeIn(transition_length, EasingTypes.OutQuint); + dragContainer.ScaleTo(1, transition_length, EasingTypes.OutElastic); + } + + protected override void PopOut() + { + FadeOut(transition_length, EasingTypes.OutQuint); + dragContainer.ScaleTo(0.9f, transition_length, EasingTypes.OutQuint); + } private enum TransformDirection { None, Next, Prev } From 30bec0876ddcf41ba54a7aae39d3748b869d69b7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 9 Feb 2017 13:53:55 +0900 Subject: [PATCH 3/5] Make MusicController a focused overlay. --- osu.Game/Overlays/MusicController.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index eaf40294a5..0390de880c 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -27,7 +27,7 @@ using osu.Game.Graphics.Sprites; namespace osu.Game.Overlays { - public class MusicController : OverlayContainer + public class MusicController : FocusedOverlayContainer { private MusicControllerBackground backgroundSprite; private DragBar progress; @@ -380,12 +380,16 @@ namespace osu.Game.Overlays protected override void PopIn() { + base.PopIn(); + FadeIn(transition_length, EasingTypes.OutQuint); dragContainer.ScaleTo(1, transition_length, EasingTypes.OutElastic); } protected override void PopOut() { + base.PopOut(); + FadeOut(transition_length, EasingTypes.OutQuint); dragContainer.ScaleTo(0.9f, transition_length, EasingTypes.OutQuint); } From 0937424e0c93a3c37dfc3f55f431af0181bd6093 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 9 Feb 2017 13:54:10 +0900 Subject: [PATCH 4/5] Add base.PopOut calls to allow for passing away focus. --- osu.Game/Overlays/LoginOverlay.cs | 2 ++ osu.Game/Overlays/OptionsOverlay.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/osu.Game/Overlays/LoginOverlay.cs b/osu.Game/Overlays/LoginOverlay.cs index 4ffa63d7cb..22c61cd372 100644 --- a/osu.Game/Overlays/LoginOverlay.cs +++ b/osu.Game/Overlays/LoginOverlay.cs @@ -72,6 +72,8 @@ namespace osu.Game.Overlays protected override void PopOut() { + base.PopOut(); + optionsSection.Bounding = false; FadeOut(transition_time); } diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs index 0b481ee068..1fce450104 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -170,6 +170,8 @@ namespace osu.Game.Overlays protected override void PopOut() { + base.PopOut(); + scrollContainer.MoveToX(-width, TRANSITION_LENGTH, EasingTypes.OutQuint); sidebar.MoveToX(-SIDEBAR_WIDTH, TRANSITION_LENGTH, EasingTypes.OutQuint); FadeTo(0, TRANSITION_LENGTH / 2); From 23bc84fa3c4e18d07daa10c70e6d68bd0f5c3930 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 9 Feb 2017 16:38:39 +0900 Subject: [PATCH 5/5] Fix borked header. --- osu.Game/Overlays/MusicController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 0390de880c..162215d556 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -1,4 +1,4 @@ -// Copyright (c) transition_length7-2017 ppy Pty Ltd . +// Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System;