1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 14:22:55 +08:00

use G to change grid type

This commit is contained in:
OliBomby 2023-12-31 02:55:47 +01:00
parent 616c2aeefc
commit d98cc7fe66

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 @@ namespace osu.Game.Rulesets.Osu.Edit
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)