1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 06:42:56 +08:00

Proper dismissing.

This commit is contained in:
DrabWeb 2017-06-23 22:35:06 -03:00
parent fc6f8b9c0c
commit 15cd4f77b2

View File

@ -19,6 +19,7 @@ using osu.Framework.Graphics.Textures;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Input;
using OpenTK.Input;
using System.Linq;
namespace osu.Game.Overlays
{
@ -37,7 +38,16 @@ namespace osu.Game.Overlays
private SampleChannel getSample;
protected override bool BlockPassThroughKeyboard => true;
protected override bool OnClick(InputState state)
{
dismiss();
return true;
}
protected override void OnFocusLost(InputState state)
{
if (state.Keyboard.Keys.Contains(Key.Escape)) dismiss();
}
public MedalOverlay(Medal medal)
{
@ -189,6 +199,12 @@ namespace osu.Game.Overlays
FadeOut(200);
}
private void dismiss()
{
if (drawableMedal.Transforms.Count != 0) return;
Hide();
}
private class BackgroundStrip : Container
{
public BackgroundStrip(float start, float end)