From de2f9dec39c193108c8919aefe24cb6fda5d6a29 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Tue, 8 Oct 2024 10:51:35 +0200 Subject: [PATCH] Let right-click reset grid to default values --- .../Edit/Blueprints/GridPlacementBlueprint.cs | 5 +++++ osu.Game.Rulesets.Osu/Edit/GridFromPointsTool.cs | 2 +- osu.Game.Rulesets.Osu/Edit/OsuGridToolboxGroup.cs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/GridPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/GridPlacementBlueprint.cs index 85042e0e32..b13663cb44 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/GridPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/GridPlacementBlueprint.cs @@ -68,6 +68,11 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints { 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; } diff --git a/osu.Game.Rulesets.Osu/Edit/GridFromPointsTool.cs b/osu.Game.Rulesets.Osu/Edit/GridFromPointsTool.cs index 5d6bc6f525..626153a7fd 100644 --- a/osu.Game.Rulesets.Osu/Edit/GridFromPointsTool.cs +++ b/osu.Game.Rulesets.Osu/Edit/GridFromPointsTool.cs @@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Osu.Edit 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. """; } diff --git a/osu.Game.Rulesets.Osu/Edit/OsuGridToolboxGroup.cs b/osu.Game.Rulesets.Osu/Edit/OsuGridToolboxGroup.cs index f71243a109..2b88860cc8 100644 --- a/osu.Game.Rulesets.Osu/Edit/OsuGridToolboxGroup.cs +++ b/osu.Game.Rulesets.Osu/Edit/OsuGridToolboxGroup.cs @@ -71,7 +71,7 @@ namespace osu.Game.Rulesets.Osu.Edit /// Read-only bindable representing the grid's origin. /// Equivalent to new Vector2(StartPositionX, StartPositionY) /// - public Bindable StartPosition { get; } = new Bindable(); + public Bindable StartPosition { get; } = new Bindable(OsuPlayfield.BASE_SIZE / 2); /// /// Read-only bindable representing the grid's spacing in both the X and Y dimension.