Fix placement blueprints not being correctly removed after a rolled back placement

This commit is contained in:
Dean Herbert
2021-04-16 14:10:21 +09:00
parent 5c0ef55691
commit 119c9b4294
5 changed files with 45 additions and 17 deletions

View File

@ -196,7 +196,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
private void refreshTool()
{
removePlacement();
createPlacement();
ensurePlacementCreated();
}
private void updatePlacementPosition()
@ -215,15 +215,26 @@ namespace osu.Game.Screens.Edit.Compose.Components
{
base.Update();
if (Composer.CursorInPlacementArea)
createPlacement();
else if (currentPlacement?.PlacementActive == false)
removePlacement();
if (currentPlacement != null)
{
updatePlacementPosition();
switch (currentPlacement.PlacementActive)
{
case PlacementBlueprint.PlacementState.Waiting:
if (!Composer.CursorInPlacementArea)
removePlacement();
break;
case PlacementBlueprint.PlacementState.Finished:
removePlacement();
break;
}
}
if (Composer.CursorInPlacementArea)
ensurePlacementCreated();
if (currentPlacement != null)
updatePlacementPosition();
}
protected sealed override SelectionBlueprint CreateBlueprintFor(HitObject hitObject)
@ -249,7 +260,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
NewCombo.Value = TernaryState.False;
}
private void createPlacement()
private void ensurePlacementCreated()
{
if (currentPlacement != null) return;