Merge branch 'master' into fix-beat-snap

This commit is contained in:
Dan Balasescu
2020-01-29 15:32:27 +09:00
committed by GitHub
41 changed files with 603 additions and 334 deletions

View File

@ -137,12 +137,12 @@ namespace osu.Game.Rulesets.Edit
}
};
toolboxCollection.Items =
CompositionTools.Select(t => new RadioButton(t.Name, () => selectTool(t)))
.Prepend(new RadioButton("Select", () => selectTool(null)))
.ToList();
toolboxCollection.Items = CompositionTools
.Prepend(new SelectTool())
.Select(t => new RadioButton(t.Name, () => toolSelected(t)))
.ToList();
toolboxCollection.Items[0].Select();
toolboxCollection.Items.First().Select();
blueprintContainer.SelectionChanged += selectionChanged;
}
@ -187,11 +187,11 @@ namespace osu.Game.Rulesets.Edit
showGridFor(hitObjects);
}
private void selectTool(HitObjectCompositionTool tool)
private void toolSelected(HitObjectCompositionTool tool)
{
blueprintContainer.CurrentTool = tool;
if (tool == null)
if (tool is SelectTool)
distanceSnapGridContainer.Hide();
else
showGridFor(Enumerable.Empty<HitObject>());

View File

@ -13,5 +13,7 @@ namespace osu.Game.Rulesets.Edit.Tools
}
public abstract PlacementBlueprint CreatePlacementBlueprint();
public override string ToString() => Name;
}
}

View File

@ -0,0 +1,15 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Game.Rulesets.Edit.Tools
{
public class SelectTool : HitObjectCompositionTool
{
public SelectTool()
: base("Select")
{
}
public override PlacementBlueprint CreatePlacementBlueprint() => null;
}
}