mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Proper dismissing.
This commit is contained in:
@ -19,6 +19,7 @@ using osu.Framework.Graphics.Textures;
|
|||||||
using osu.Framework.Graphics.Transforms;
|
using osu.Framework.Graphics.Transforms;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
@ -37,7 +38,16 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private SampleChannel getSample;
|
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)
|
public MedalOverlay(Medal medal)
|
||||||
{
|
{
|
||||||
@ -189,6 +199,12 @@ namespace osu.Game.Overlays
|
|||||||
FadeOut(200);
|
FadeOut(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void dismiss()
|
||||||
|
{
|
||||||
|
if (drawableMedal.Transforms.Count != 0) return;
|
||||||
|
Hide();
|
||||||
|
}
|
||||||
|
|
||||||
private class BackgroundStrip : Container
|
private class BackgroundStrip : Container
|
||||||
{
|
{
|
||||||
public BackgroundStrip(float start, float end)
|
public BackgroundStrip(float start, float end)
|
||||||
|
Reference in New Issue
Block a user