mirror of
https://github.com/ppy/osu
synced 2025-02-16 10:07:11 +00:00
Add back the old keybind for cycling grid spacing
This commit is contained in:
parent
e56a9d2ad4
commit
b93bc21e45
@ -169,6 +169,29 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
|
||||
};
|
||||
}
|
||||
|
||||
[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]
|
||||
public void TestGridTypeToggling()
|
||||
{
|
||||
@ -183,7 +206,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -264,6 +264,10 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
case GlobalAction.EditorCycleGridDisplayMode:
|
||||
nextGridSize();
|
||||
return true;
|
||||
|
||||
case GlobalAction.EditorCycleGridType:
|
||||
nextGridType();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -135,6 +135,7 @@ namespace osu.Game.Input.Bindings
|
||||
new KeyBinding(new[] { InputKey.J }, GlobalAction.EditorNudgeLeft),
|
||||
new KeyBinding(new[] { InputKey.K }, GlobalAction.EditorNudgeRight),
|
||||
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.T }, GlobalAction.EditorTapForBPM),
|
||||
new KeyBinding(new[] { InputKey.Control, InputKey.H }, GlobalAction.EditorFlipHorizontally),
|
||||
@ -371,6 +372,9 @@ namespace osu.Game.Input.Bindings
|
||||
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorCycleGridDisplayMode))]
|
||||
EditorCycleGridDisplayMode,
|
||||
|
||||
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorCycleGridType))]
|
||||
EditorCycleGridType,
|
||||
|
||||
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorTestGameplay))]
|
||||
EditorTestGameplay,
|
||||
|
||||
|
@ -194,6 +194,11 @@ namespace osu.Game.Localisation
|
||||
/// </summary>
|
||||
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>
|
||||
/// "Test gameplay"
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user