1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 08:02:55 +08:00

Don't show distance snap grid for spinners (for now)

This commit is contained in:
Dean Herbert 2020-02-07 19:08:49 +09:00
parent 6297606baa
commit a6531bf73e
2 changed files with 12 additions and 5 deletions

View File

@ -36,6 +36,9 @@ namespace osu.Game.Rulesets.Osu.Edit
protected override DistanceSnapGrid CreateDistanceSnapGrid(IEnumerable<HitObject> selectedHitObjects)
{
if (BlueprintContainer.CurrentTool is SpinnerCompositionTool)
return null;
var objects = selectedHitObjects.ToList();
if (objects.Count == 0)
@ -89,6 +92,9 @@ namespace osu.Game.Rulesets.Osu.Edit
targetIndex++;
}
if (sourceObject is Spinner)
return null;
return new OsuDistanceSnapGrid((OsuHitObject)sourceObject, (OsuHitObject)targetObject);
}
}

View File

@ -49,8 +49,9 @@ namespace osu.Game.Rulesets.Edit
[Resolved]
private IBeatSnapProvider beatSnapProvider { get; set; }
protected ComposeBlueprintContainer BlueprintContainer;
private DrawableEditRulesetWrapper<TObject> drawableRulesetWrapper;
private ComposeBlueprintContainer blueprintContainer;
private Container distanceSnapGridContainer;
private DistanceSnapGrid distanceSnapGrid;
private readonly List<Container> layerContainers = new List<Container>();
@ -94,7 +95,7 @@ namespace osu.Game.Rulesets.Edit
new EditorPlayfieldBorder { RelativeSizeAxes = Axes.Both }
});
var layerAboveRuleset = drawableRulesetWrapper.CreatePlayfieldAdjustmentContainer().WithChild(blueprintContainer = CreateBlueprintContainer());
var layerAboveRuleset = drawableRulesetWrapper.CreatePlayfieldAdjustmentContainer().WithChild(BlueprintContainer = CreateBlueprintContainer());
layerContainers.Add(layerBelowRuleset);
layerContainers.Add(layerAboveRuleset);
@ -142,7 +143,7 @@ namespace osu.Game.Rulesets.Edit
setSelectTool();
blueprintContainer.SelectionChanged += selectionChanged;
BlueprintContainer.SelectionChanged += selectionChanged;
}
protected override bool OnKeyDown(KeyDownEvent e)
@ -174,7 +175,7 @@ namespace osu.Game.Rulesets.Edit
{
base.Update();
if (EditorClock.CurrentTime != lastGridUpdateTime && !(blueprintContainer.CurrentTool is SelectTool))
if (EditorClock.CurrentTime != lastGridUpdateTime && !(BlueprintContainer.CurrentTool is SelectTool))
showGridFor(Enumerable.Empty<HitObject>());
}
@ -210,7 +211,7 @@ namespace osu.Game.Rulesets.Edit
private void toolSelected(HitObjectCompositionTool tool)
{
blueprintContainer.CurrentTool = tool;
BlueprintContainer.CurrentTool = tool;
if (tool is SelectTool)
distanceSnapGridContainer.Hide();