mirror of https://github.com/ppy/osu
use G to change grid type
This commit is contained in:
parent
616c2aeefc
commit
d98cc7fe66
|
@ -25,6 +25,10 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||||
{
|
{
|
||||||
public partial class OsuGridToolboxGroup : EditorToolboxGroup, IKeyBindingHandler<GlobalAction>
|
public partial class OsuGridToolboxGroup : EditorToolboxGroup, IKeyBindingHandler<GlobalAction>
|
||||||
{
|
{
|
||||||
|
private static readonly PositionSnapGridType[] grid_types = Enum.GetValues(typeof(PositionSnapGridType)).Cast<PositionSnapGridType>().ToArray();
|
||||||
|
|
||||||
|
private int currentGridTypeIndex;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private EditorBeatmap editorBeatmap { get; set; } = null!;
|
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;
|
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)
|
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||||
{
|
{
|
||||||
switch (e.Action)
|
switch (e.Action)
|
||||||
|
|
Loading…
Reference in New Issue