mirror of
https://github.com/osukey/osukey.git
synced 2025-05-03 04:37:30 +09:00
Force placement of in-progress object when changing tools in the editor
This commit is contained in:
parent
f443cfb93e
commit
70e248b927
@ -317,12 +317,16 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void commitIfPlacementActive()
|
||||||
|
{
|
||||||
|
CurrentPlacement?.EndPlacement(CurrentPlacement.PlacementActive == PlacementBlueprint.PlacementState.Active);
|
||||||
|
removePlacement();
|
||||||
|
}
|
||||||
|
|
||||||
private void removePlacement()
|
private void removePlacement()
|
||||||
{
|
{
|
||||||
if (CurrentPlacement == null) return;
|
CurrentPlacement?.EndPlacement(false);
|
||||||
|
CurrentPlacement?.Expire();
|
||||||
CurrentPlacement.EndPlacement(false);
|
|
||||||
CurrentPlacement.Expire();
|
|
||||||
CurrentPlacement = null;
|
CurrentPlacement = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,7 +346,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
currentTool = value;
|
currentTool = value;
|
||||||
|
|
||||||
refreshTool();
|
// As per stable editor, when changing tools, we should forcefully commit any pending placement.
|
||||||
|
commitIfPlacementActive();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user