use G to change grid type

This commit is contained in:
OliBomby 2023-12-31 02:55:47 +01:00
parent 616c2aeefc
commit d98cc7fe66
1 changed files with 11 additions and 0 deletions

View File

@ -25,6 +25,10 @@ namespace osu.Game.Rulesets.Osu.Edit
{
public partial class OsuGridToolboxGroup : EditorToolboxGroup, IKeyBindingHandler<GlobalAction>
{
private static readonly PositionSnapGridType[] grid_types = Enum.GetValues(typeof(PositionSnapGridType)).Cast<PositionSnapGridType>().ToArray();
private int currentGridTypeIndex;
[Resolved]
private EditorBeatmap editorBeatmap { get; set; } = null!;
@ -246,6 +250,13 @@ private void nextGridSize()
Spacing.Value = Spacing.Value * 2 >= max_automatic_spacing ? Spacing.Value / 8 : Spacing.Value * 2;
}
private void nextGridType()
{
currentGridTypeIndex = (currentGridTypeIndex + 1) % grid_types.Length;
GridType.Value = grid_types[currentGridTypeIndex];
gridTypeButtons.Items[currentGridTypeIndex].Select();
}
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
{
switch (e.Action)