mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 09:22:54 +08:00
Start a map using enter key.
This commit is contained in:
parent
21f993d149
commit
9557821776
@ -28,6 +28,8 @@ using osu.Framework.Audio.Sample;
|
|||||||
using osu.Framework.Graphics.Transformations;
|
using osu.Framework.Graphics.Transformations;
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
|
using osu.Framework.Input;
|
||||||
|
using OpenTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
{
|
{
|
||||||
@ -141,17 +143,22 @@ namespace osu.Game.Screens.Select
|
|||||||
Width = 100,
|
Width = 100,
|
||||||
Text = "Play",
|
Text = "Play",
|
||||||
Colour = new Color4(238, 51, 153, 255),
|
Colour = new Color4(238, 51, 153, 255),
|
||||||
Action = () => Push(new Player
|
Action = start
|
||||||
{
|
|
||||||
BeatmapInfo = carousel.SelectedGroup.SelectedPanel.Beatmap,
|
|
||||||
PreferredPlayMode = playMode.Value
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void start()
|
||||||
|
{
|
||||||
|
Push(new Player
|
||||||
|
{
|
||||||
|
BeatmapInfo = carousel.SelectedGroup.SelectedPanel.Beatmap,
|
||||||
|
PreferredPlayMode = playMode.Value
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(permitNulls: true)]
|
[BackgroundDependencyLoader(permitNulls: true)]
|
||||||
private void load(BeatmapDatabase beatmaps, AudioManager audio, BaseGame game, OsuGame osuGame)
|
private void load(BeatmapDatabase beatmaps, AudioManager audio, BaseGame game, OsuGame osuGame)
|
||||||
{
|
{
|
||||||
@ -343,5 +350,17 @@ namespace osu.Game.Screens.Select
|
|||||||
addBeatmapSet(beatmapSet, game);
|
addBeatmapSet(beatmapSet, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||||
|
{
|
||||||
|
switch (args.Key)
|
||||||
|
{
|
||||||
|
case Key.Enter:
|
||||||
|
start();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.OnKeyDown(state, args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user