Make show/hide only invoked once each

This commit is contained in:
smoogipoo
2018-11-13 13:00:00 +09:00
parent 819cba31ce
commit 6d43baf4bf
2 changed files with 47 additions and 7 deletions

View File

@ -134,10 +134,15 @@ namespace osu.Game.Screens.Edit.Compose.Components
{
base.Update();
if (composer.RulesetContainer.Playfield.ReceivePositionalInputAt(inputManager.CurrentState.Mouse.Position))
currentPlacement?.Show();
else if (currentPlacement?.PlacementBegun == false)
currentPlacement?.Hide();
if (currentPlacement != null)
{
bool cursorInPlayfield = composer.RulesetContainer.Playfield.ReceivePositionalInputAt(inputManager.CurrentState.Mouse.Position);
if (cursorInPlayfield)
currentPlacement.State = PlacementState.Shown;
else if (currentPlacement?.PlacementBegun == false)
currentPlacement.State = PlacementState.Hidden;
}
}
/// <summary>
@ -153,7 +158,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
placementBlueprintContainer.Child = currentPlacement = blueprint;
}
/// <summary>
/// Select all masks in a given rectangle selection area.
/// </summary>