Fixed typo, made mod select take focus when visible

This commit is contained in:
DrabWeb 2017-02-18 07:50:22 -04:00
parent d82b67ee9b
commit d1af050355
2 changed files with 26 additions and 1 deletions

View File

@ -137,7 +137,7 @@ namespace osu.Game.Modes
switch (mode)
{
case PlayMode.Osu:
return "You don't need to click. \nGive your clicking/tapping finger a break from the heat of things.";
return "You don't need to click.\nGive your clicking/tapping finger a break from the heat of things.";
case PlayMode.Taiko:
return @"Relax! You will no longer get dizzyfied by ninja-like spinners, demanding drumrolls or unexpected katu's.";

View File

@ -15,6 +15,9 @@ using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Sprites;
using osu.Game.Modes;
using osu.Framework.Allocation;
using osu.Framework.Input;
using OpenTK.Input;
using System.Linq;
namespace osu.Game.Overlays.Mods
{
@ -84,6 +87,28 @@ namespace osu.Game.Overlays.Mods
}
}
public override bool RequestingFocus => State == Visibility.Visible;
protected override bool OnFocus(InputState state) => true;
protected override void OnFocusLost(InputState state)
{
if (state.Keyboard.Keys.Contains(Key.Escape))
Hide();
base.OnFocusLost(state);
}
protected override void PopIn()
{
base.PopIn();
Schedule(TriggerFocusContention);
}
protected override void PopOut()
{
base.PopOut();
TriggerFocusLost();
}
protected override void TransitionIn()
{
rankedMultiplerContainer.MoveToX(0, ranked_multiplier_duration, EasingTypes.OutQuint);