mirror of https://github.com/ppy/osu
Fix grid type cycling not taking into account the radio button selection
This commit is contained in:
parent
b93bc21e45
commit
ada20d230a
|
@ -27,8 +27,6 @@ public partial class OsuGridToolboxGroup : EditorToolboxGroup, IKeyBindingHandle
|
||||||
{
|
{
|
||||||
private static readonly PositionSnapGridType[] grid_types = Enum.GetValues(typeof(PositionSnapGridType)).Cast<PositionSnapGridType>().ToArray();
|
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!;
|
||||||
|
|
||||||
|
@ -252,9 +250,9 @@ private void nextGridSize()
|
||||||
|
|
||||||
private void nextGridType()
|
private void nextGridType()
|
||||||
{
|
{
|
||||||
currentGridTypeIndex = (currentGridTypeIndex + 1) % grid_types.Length;
|
int nextGridTypeIndex = (Array.IndexOf(grid_types, GridType.Value) + 1) % grid_types.Length;
|
||||||
GridType.Value = grid_types[currentGridTypeIndex];
|
GridType.Value = grid_types[nextGridTypeIndex];
|
||||||
gridTypeButtons.Items[currentGridTypeIndex].Select();
|
gridTypeButtons.Items[nextGridTypeIndex].Select();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||||
|
|
Loading…
Reference in New Issue