mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 03:02:54 +08:00
move GridFromPointsClicked handler creation code
This commit is contained in:
parent
98505d0bba
commit
b54c9a36fe
@ -22,6 +22,13 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
|
||||
private Vector2? startPosition;
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
gridToolboxGroup.GridFromPointsClicked += BeginPlacement;
|
||||
}
|
||||
|
||||
public void BeginPlacement()
|
||||
{
|
||||
IsPlacing = true;
|
||||
|
@ -63,6 +63,8 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
|
||||
private Bindable<HitObject> placementObject;
|
||||
|
||||
private GridFromPointsTool gridFromPointsTool;
|
||||
|
||||
[Cached(typeof(IDistanceSnapProvider))]
|
||||
protected readonly OsuDistanceSnapProvider DistanceSnapProvider = new OsuDistanceSnapProvider();
|
||||
|
||||
@ -99,7 +101,6 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
updateDistanceSnapGrid();
|
||||
|
||||
OsuGridToolboxGroup.GridType.BindValueChanged(updatePositionSnapGrid, true);
|
||||
OsuGridToolboxGroup.GridFromPointsClicked += () => gridFromPointsTool.BeginPlacement();
|
||||
|
||||
LayerAboveRuleset.Add(
|
||||
// Place it above the playfield and blueprints, so it takes priority when handling input.
|
||||
@ -118,8 +119,6 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
);
|
||||
}
|
||||
|
||||
private GridFromPointsTool gridFromPointsTool;
|
||||
|
||||
private void updatePositionSnapGrid(ValueChangedEvent<PositionSnapGridType> obj)
|
||||
{
|
||||
if (positionSnapGrid != null)
|
||||
|
Loading…
Reference in New Issue
Block a user