1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 05:52:55 +08:00

Make LoginOverlay and OptionsOverlay focused containers.

This commit is contained in:
Dean Herbert 2017-02-08 15:13:32 +09:00
parent a6f02106a4
commit 5eb3ef3948
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
2 changed files with 6 additions and 20 deletions

View File

@ -14,7 +14,7 @@ using OpenTK.Graphics;
namespace osu.Game.Overlays
{
class LoginOverlay : OverlayContainer
class LoginOverlay : FocusedOverlayContainer
{
private LoginOptions optionsSection;
@ -64,6 +64,8 @@ namespace osu.Game.Overlays
protected override void PopIn()
{
base.PopIn();
optionsSection.Bounding = true;
FadeIn(transition_time, EasingTypes.OutQuint);
}

View File

@ -23,7 +23,7 @@ using osu.Game.Overlays.Options.Sections;
namespace osu.Game.Overlays
{
public class OptionsOverlay : OverlayContainer
public class OptionsOverlay : FocusedOverlayContainer
{
internal const float CONTENT_MARGINS = 10;
@ -159,26 +159,10 @@ namespace osu.Game.Overlays
}
}
protected override bool OnHover(InputState state) => true;
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
protected override bool OnClick(InputState state) => true;
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
switch (args.Key)
{
case Key.Escape:
if (State == Visibility.Hidden) return false;
Hide();
return true;
}
return base.OnKeyDown(state, args);
}
protected override void PopIn()
{
base.PopIn();
scrollContainer.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint);
sidebar.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint);
FadeTo(1, TRANSITION_LENGTH / 2);