Skip to content

Commit

Permalink
Let right-click reset grid to default values
Browse files Browse the repository at this point in the history
  • Loading branch information
OliBomby committed Oct 8, 2024
1 parent e794862 commit de2f9de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ protected override bool OnMouseDown(MouseDownEvent e)
{
if (e.Button == MouseButton.Right)
{
// Reset the grid to the default values.
gridToolboxGroup.StartPosition.Value = gridToolboxGroup.StartPosition.Default;
gridToolboxGroup.Spacing.Value = gridToolboxGroup.Spacing.Default;
if (!gridToolboxGroup.GridLinesRotation.Disabled)
gridToolboxGroup.GridLinesRotation.Value = gridToolboxGroup.GridLinesRotation.Default;
EndPlacement(true);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Osu/Edit/GridFromPointsTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public GridFromPointsTool()
TooltipText = """
Left click to set the origin.
Left click again to set the spacing and rotation.
Right click to only set the origin.
Right click to reset to default.
Click and drag to set the origin, spacing and rotation.
""";
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Osu/Edit/OsuGridToolboxGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public partial class OsuGridToolboxGroup : EditorToolboxGroup, IKeyBindingHandle
/// Read-only bindable representing the grid's origin.
/// Equivalent to <code>new Vector2(StartPositionX, StartPositionY)</code>
/// </summary>
public Bindable<Vector2> StartPosition { get; } = new Bindable<Vector2>();
public Bindable<Vector2> StartPosition { get; } = new Bindable<Vector2>(OsuPlayfield.BASE_SIZE / 2);

/// <summary>
/// Read-only bindable representing the grid's spacing in both the X and Y dimension.
Expand Down

0 comments on commit de2f9de

Please sign in to comment.