mirror of https://github.com/ppy/osu
Add back the old keybind for cycling grid spacing
This commit is contained in:
parent
e56a9d2ad4
commit
b93bc21e45
|
@ -169,6 +169,29 @@ private Vector2 uniqueSnappingPosition(PositionSnapGrid grid)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestGridSizeToggling()
|
||||||
|
{
|
||||||
|
AddStep("enable rectangular grid", () => InputManager.Key(Key.Y));
|
||||||
|
AddUntilStep("rectangular grid visible", () => this.ChildrenOfType<RectangularPositionSnapGrid>().Any());
|
||||||
|
gridSizeIs(4);
|
||||||
|
|
||||||
|
nextGridSizeIs(8);
|
||||||
|
nextGridSizeIs(16);
|
||||||
|
nextGridSizeIs(32);
|
||||||
|
nextGridSizeIs(4);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void nextGridSizeIs(int size)
|
||||||
|
{
|
||||||
|
AddStep("toggle to next grid size", () => InputManager.Key(Key.G));
|
||||||
|
gridSizeIs(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void gridSizeIs(int size)
|
||||||
|
=> AddAssert($"grid size is {size}", () => this.ChildrenOfType<RectangularPositionSnapGrid>().Single().Spacing.Value == new Vector2(size)
|
||||||
|
&& EditorBeatmap.BeatmapInfo.GridSize == size);
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestGridTypeToggling()
|
public void TestGridTypeToggling()
|
||||||
{
|
{
|
||||||
|
@ -183,7 +206,7 @@ public void TestGridTypeToggling()
|
||||||
|
|
||||||
private void nextGridTypeIs<T>() where T : PositionSnapGrid
|
private void nextGridTypeIs<T>() where T : PositionSnapGrid
|
||||||
{
|
{
|
||||||
AddStep("toggle to next grid type", () => InputManager.Key(Key.G));
|
AddStep("toggle to next grid type", () => InputManager.Key(Key.H));
|
||||||
gridActive<T>(true);
|
gridActive<T>(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -264,6 +264,10 @@ public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||||
case GlobalAction.EditorCycleGridDisplayMode:
|
case GlobalAction.EditorCycleGridDisplayMode:
|
||||||
nextGridSize();
|
nextGridSize();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
case GlobalAction.EditorCycleGridType:
|
||||||
|
nextGridType();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -135,6 +135,7 @@ public static IEnumerable<GlobalAction> GetGlobalActionsFor(GlobalActionCategory
|
||||||
new KeyBinding(new[] { InputKey.J }, GlobalAction.EditorNudgeLeft),
|
new KeyBinding(new[] { InputKey.J }, GlobalAction.EditorNudgeLeft),
|
||||||
new KeyBinding(new[] { InputKey.K }, GlobalAction.EditorNudgeRight),
|
new KeyBinding(new[] { InputKey.K }, GlobalAction.EditorNudgeRight),
|
||||||
new KeyBinding(new[] { InputKey.G }, GlobalAction.EditorCycleGridDisplayMode),
|
new KeyBinding(new[] { InputKey.G }, GlobalAction.EditorCycleGridDisplayMode),
|
||||||
|
new KeyBinding(new[] { InputKey.H }, GlobalAction.EditorCycleGridType),
|
||||||
new KeyBinding(new[] { InputKey.F5 }, GlobalAction.EditorTestGameplay),
|
new KeyBinding(new[] { InputKey.F5 }, GlobalAction.EditorTestGameplay),
|
||||||
new KeyBinding(new[] { InputKey.T }, GlobalAction.EditorTapForBPM),
|
new KeyBinding(new[] { InputKey.T }, GlobalAction.EditorTapForBPM),
|
||||||
new KeyBinding(new[] { InputKey.Control, InputKey.H }, GlobalAction.EditorFlipHorizontally),
|
new KeyBinding(new[] { InputKey.Control, InputKey.H }, GlobalAction.EditorFlipHorizontally),
|
||||||
|
@ -371,6 +372,9 @@ public enum GlobalAction
|
||||||
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorCycleGridDisplayMode))]
|
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorCycleGridDisplayMode))]
|
||||||
EditorCycleGridDisplayMode,
|
EditorCycleGridDisplayMode,
|
||||||
|
|
||||||
|
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorCycleGridType))]
|
||||||
|
EditorCycleGridType,
|
||||||
|
|
||||||
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorTestGameplay))]
|
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorTestGameplay))]
|
||||||
EditorTestGameplay,
|
EditorTestGameplay,
|
||||||
|
|
||||||
|
|
|
@ -194,6 +194,11 @@ public static class GlobalActionKeyBindingStrings
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString EditorCycleGridDisplayMode => new TranslatableString(getKey(@"editor_cycle_grid_display_mode"), @"Cycle grid display mode");
|
public static LocalisableString EditorCycleGridDisplayMode => new TranslatableString(getKey(@"editor_cycle_grid_display_mode"), @"Cycle grid display mode");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Cycle grid type"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString EditorCycleGridType => new TranslatableString(getKey(@"editor_cycle_grid_type"), @"Cycle grid type");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "Test gameplay"
|
/// "Test gameplay"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue