mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 19:12:56 +08:00
Make hit object and sample point seek keybinds configurable
This commit is contained in:
parent
f36321a8ea
commit
306dc37ab5
@ -147,6 +147,10 @@ namespace osu.Game.Input.Bindings
|
|||||||
new KeyBinding(new[] { InputKey.Control, InputKey.Shift, InputKey.MouseWheelLeft }, GlobalAction.EditorCycleNextBeatSnapDivisor),
|
new KeyBinding(new[] { InputKey.Control, InputKey.Shift, InputKey.MouseWheelLeft }, GlobalAction.EditorCycleNextBeatSnapDivisor),
|
||||||
new KeyBinding(new[] { InputKey.Control, InputKey.R }, GlobalAction.EditorToggleRotateControl),
|
new KeyBinding(new[] { InputKey.Control, InputKey.R }, GlobalAction.EditorToggleRotateControl),
|
||||||
new KeyBinding(new[] { InputKey.Control, InputKey.E }, GlobalAction.EditorToggleScaleControl),
|
new KeyBinding(new[] { InputKey.Control, InputKey.E }, GlobalAction.EditorToggleScaleControl),
|
||||||
|
new KeyBinding(new[] { InputKey.Alt, InputKey.Left }, GlobalAction.EditorSeekToPreviousHitObject),
|
||||||
|
new KeyBinding(new[] { InputKey.Alt, InputKey.Right }, GlobalAction.EditorSeekToNextHitObject),
|
||||||
|
new KeyBinding(new[] { InputKey.Alt, InputKey.Shift, InputKey.Left }, GlobalAction.EditorSeekToPreviousSamplePoint),
|
||||||
|
new KeyBinding(new[] { InputKey.Alt, InputKey.Shift, InputKey.Right }, GlobalAction.EditorSeekToNextSamplePoint),
|
||||||
};
|
};
|
||||||
|
|
||||||
private static IEnumerable<KeyBinding> editorTestPlayKeyBindings => new[]
|
private static IEnumerable<KeyBinding> editorTestPlayKeyBindings => new[]
|
||||||
@ -456,6 +460,18 @@ namespace osu.Game.Input.Bindings
|
|||||||
|
|
||||||
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorTestPlayQuickExitToCurrentTime))]
|
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorTestPlayQuickExitToCurrentTime))]
|
||||||
EditorTestPlayQuickExitToCurrentTime,
|
EditorTestPlayQuickExitToCurrentTime,
|
||||||
|
|
||||||
|
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorSeekToPreviousHitObject))]
|
||||||
|
EditorSeekToPreviousHitObject,
|
||||||
|
|
||||||
|
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorSeekToNextHitObject))]
|
||||||
|
EditorSeekToNextHitObject,
|
||||||
|
|
||||||
|
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorSeekToPreviousSamplePoint))]
|
||||||
|
EditorSeekToPreviousSamplePoint,
|
||||||
|
|
||||||
|
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorSeekToNextSamplePoint))]
|
||||||
|
EditorSeekToNextSamplePoint,
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum GlobalActionCategory
|
public enum GlobalActionCategory
|
||||||
|
@ -404,6 +404,26 @@ namespace osu.Game.Localisation
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString DecreaseModSpeed => new TranslatableString(getKey(@"decrease_mod_speed"), @"Decrease mod speed");
|
public static LocalisableString DecreaseModSpeed => new TranslatableString(getKey(@"decrease_mod_speed"), @"Decrease mod speed");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Seek to previous hit object"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString EditorSeekToPreviousHitObject => new TranslatableString(getKey(@"editor_seek_to_previous_hit_object"), @"Seek to previous hit object");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Seek to next hit object"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString EditorSeekToNextHitObject => new TranslatableString(getKey(@"editor_seek_to_next_hit_object"), @"Seek to next hit object");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Seek to previous sample point"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString EditorSeekToPreviousSamplePoint => new TranslatableString(getKey(@"editor_seek_to_previous_sample_point"), @"Seek to previous sample point");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Seek to next sample point"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString EditorSeekToNextSamplePoint => new TranslatableString(getKey(@"editor_seek_to_next_sample_point"), @"Seek to next sample point");
|
||||||
|
|
||||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -594,7 +594,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
protected override bool OnKeyDown(KeyDownEvent e)
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
{
|
{
|
||||||
if (e.ControlPressed || e.SuperPressed) return false;
|
if (e.ControlPressed || e.AltPressed || e.SuperPressed) return false;
|
||||||
|
|
||||||
switch (e.Key)
|
switch (e.Key)
|
||||||
{
|
{
|
||||||
@ -746,6 +746,22 @@ namespace osu.Game.Screens.Edit
|
|||||||
bottomBar.TestGameplayButton.TriggerClick();
|
bottomBar.TestGameplayButton.TriggerClick();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
case GlobalAction.EditorSeekToPreviousHitObject:
|
||||||
|
seekHitObject(-1);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case GlobalAction.EditorSeekToNextHitObject:
|
||||||
|
seekHitObject(1);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case GlobalAction.EditorSeekToPreviousSamplePoint:
|
||||||
|
seekSamplePoint(-1);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case GlobalAction.EditorSeekToNextSamplePoint:
|
||||||
|
seekSamplePoint(1);
|
||||||
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1130,15 +1146,6 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
private void seek(UIEvent e, int direction)
|
private void seek(UIEvent e, int direction)
|
||||||
{
|
{
|
||||||
if (e.AltPressed)
|
|
||||||
{
|
|
||||||
if (e.ShiftPressed)
|
|
||||||
seekSamplePoint(direction);
|
|
||||||
else
|
|
||||||
seekHitObject(direction);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
double amount = e.ShiftPressed ? 4 : 1;
|
double amount = e.ShiftPressed ? 4 : 1;
|
||||||
|
|
||||||
bool trackPlaying = clock.IsRunning;
|
bool trackPlaying = clock.IsRunning;
|
||||||
|
Loading…
Reference in New Issue
Block a user