mirror of
https://github.com/ppy/osu
synced 2025-01-10 08:09:40 +00:00
Add key binding for beatmap selection in song select
This commit is contained in:
parent
533574e3d0
commit
d52a1a5d23
@ -100,10 +100,12 @@ namespace osu.Game.Input.Bindings
|
|||||||
|
|
||||||
public IEnumerable<KeyBinding> SongSelectKeyBindings => new[]
|
public IEnumerable<KeyBinding> SongSelectKeyBindings => new[]
|
||||||
{
|
{
|
||||||
|
new KeyBinding(InputKey.Left, GlobalAction.SelectPreviousBeatmap),
|
||||||
|
new KeyBinding(InputKey.Right, GlobalAction.SelectNextBeatmap),
|
||||||
new KeyBinding(InputKey.F1, GlobalAction.ToggleModSelection),
|
new KeyBinding(InputKey.F1, GlobalAction.ToggleModSelection),
|
||||||
new KeyBinding(InputKey.F2, GlobalAction.SelectNextRandom),
|
new KeyBinding(InputKey.F2, GlobalAction.SelectNextRandom),
|
||||||
new KeyBinding(new[] { InputKey.Shift, InputKey.F2 }, GlobalAction.SelectPreviousRandom),
|
new KeyBinding(new[] { InputKey.Shift, InputKey.F2 }, GlobalAction.SelectPreviousRandom),
|
||||||
new KeyBinding(InputKey.F3, GlobalAction.ToggleBeatmapOptions)
|
new KeyBinding(InputKey.F3, GlobalAction.ToggleBeatmapOptions),
|
||||||
};
|
};
|
||||||
|
|
||||||
public IEnumerable<KeyBinding> AudioControlKeyBindings => new[]
|
public IEnumerable<KeyBinding> AudioControlKeyBindings => new[]
|
||||||
@ -301,5 +303,11 @@ namespace osu.Game.Input.Bindings
|
|||||||
|
|
||||||
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorFlipVertically))]
|
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorFlipVertically))]
|
||||||
EditorFlipVertically,
|
EditorFlipVertically,
|
||||||
|
|
||||||
|
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.SelectPreviousBeatmap))]
|
||||||
|
SelectPreviousBeatmap,
|
||||||
|
|
||||||
|
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.SelectNextBeatmap))]
|
||||||
|
SelectNextBeatmap,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -194,6 +194,16 @@ namespace osu.Game.Localisation
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString ToggleInGameInterface => new TranslatableString(getKey(@"toggle_in_game_interface"), @"Toggle in-game interface");
|
public static LocalisableString ToggleInGameInterface => new TranslatableString(getKey(@"toggle_in_game_interface"), @"Toggle in-game interface");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Previous beatmap selection"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString SelectPreviousBeatmap => new TranslatableString(getKey(@"select_previous_beatmap"), @"Previous beatmap selection");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Next beatmap selection"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString SelectNextBeatmap => new TranslatableString(getKey(@"select_next_beatmap"), @"Next beatmap selection");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "Toggle Mod Select"
|
/// "Toggle Mod Select"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -604,34 +604,20 @@ namespace osu.Game.Screens.Select
|
|||||||
public void ScrollToSelected(bool immediate = false) =>
|
public void ScrollToSelected(bool immediate = false) =>
|
||||||
pendingScrollOperation = immediate ? PendingScrollOperation.Immediate : PendingScrollOperation.Standard;
|
pendingScrollOperation = immediate ? PendingScrollOperation.Immediate : PendingScrollOperation.Standard;
|
||||||
|
|
||||||
#region Key / button selection logic
|
#region Button selection logic
|
||||||
|
|
||||||
protected override bool OnKeyDown(KeyDownEvent e)
|
|
||||||
{
|
|
||||||
switch (e.Key)
|
|
||||||
{
|
|
||||||
case Key.Left:
|
|
||||||
SelectNext(-1);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case Key.Right:
|
|
||||||
SelectNext();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||||
{
|
{
|
||||||
switch (e.Action)
|
switch (e.Action)
|
||||||
{
|
{
|
||||||
case GlobalAction.SelectNext:
|
case GlobalAction.SelectNext:
|
||||||
SelectNext(1, false);
|
case GlobalAction.SelectNextBeatmap:
|
||||||
|
SelectNext(1, e.Action == GlobalAction.SelectNextBeatmap);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case GlobalAction.SelectPrevious:
|
case GlobalAction.SelectPrevious:
|
||||||
SelectNext(-1, false);
|
case GlobalAction.SelectPreviousBeatmap:
|
||||||
|
SelectNext(-1, e.Action == GlobalAction.SelectPreviousBeatmap);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user