1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-04 01:08:12 +08:00

Make LoginOverlay and OptionsOverlay focused containers.

This commit is contained in:
Dean Herbert
2017-02-08 15:13:32 +09:00
Unverified
parent a6f02106a4
commit 5eb3ef3948
2 changed files with 6 additions and 20 deletions
+3 -1
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);
}
+3 -19
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);