Relieve OsuScreen of back button input duties

This commit is contained in:
smoogipoo
2019-06-25 17:17:29 +09:00
parent f53d2fbe76
commit d9927204f8
4 changed files with 28 additions and 22 deletions

View File

@ -34,10 +34,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Bindings;
namespace osu.Game.Screens.Select
{
public abstract class SongSelect : OsuScreen
public abstract class SongSelect : OsuScreen, IKeyBindingHandler<GlobalAction>
{
private static readonly Vector2 wedged_container_size = new Vector2(0.5f, 245);
@ -645,7 +646,7 @@ namespace osu.Game.Screens.Select
Schedule(() => BeatmapDetails.Leaderboard.RefreshScores())));
}
public override bool OnPressed(GlobalAction action)
public virtual bool OnPressed(GlobalAction action)
{
if (!this.IsCurrentScreen()) return false;
@ -656,9 +657,11 @@ namespace osu.Game.Screens.Select
return true;
}
return base.OnPressed(action);
return false;
}
public bool OnReleased(GlobalAction action) => action == GlobalAction.Select;
protected override bool OnKeyDown(KeyDownEvent e)
{
if (e.Repeat) return false;