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