Skip to content

Commit

Permalink
Merge pull request ppy#29440 from OliBomby/spacebar-resume
Browse files Browse the repository at this point in the history
Allow play/pause with spacebar while placing hitobjects
  • Loading branch information
peppy authored Aug 30, 2024
2 parents b1530e4 + 3d4bc8a commit 60c1e0f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 35 deletions.
32 changes: 1 addition & 31 deletions osu.Game.Tests/Visual/Editing/TestScenePlacementBlueprint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,32 +96,6 @@ public void TestCommitPlacementViaRightClick()
AddAssert("slider placed", () => EditorBeatmap.HitObjects.Count, () => Is.EqualTo(1));
}

[Test]
public void TestCommitPlacementViaGlobalAction()
{
Playfield playfield = null!;

AddStep("select slider placement tool", () => InputManager.Key(Key.Number3));
AddStep("move mouse to top left of playfield", () =>
{
playfield = this.ChildrenOfType<Playfield>().Single();
var location = (3 * playfield.ScreenSpaceDrawQuad.TopLeft + playfield.ScreenSpaceDrawQuad.BottomRight) / 4;
InputManager.MoveMouseTo(location);
});
AddStep("begin placement", () => InputManager.Click(MouseButton.Left));
AddStep("move mouse to bottom right of playfield", () =>
{
var location = (playfield.ScreenSpaceDrawQuad.TopLeft + 3 * playfield.ScreenSpaceDrawQuad.BottomRight) / 4;
InputManager.MoveMouseTo(location);
});
AddStep("confirm via global action", () =>
{
globalActionContainer.TriggerPressed(GlobalAction.Select);
globalActionContainer.TriggerReleased(GlobalAction.Select);
});
AddAssert("slider placed", () => EditorBeatmap.HitObjects.Count, () => Is.EqualTo(1));
}

[Test]
public void TestAbortPlacementViaGlobalAction()
{
Expand Down Expand Up @@ -272,11 +246,7 @@ public void TestNodeSamplesAndSamplesAreSame()
var location = (playfield.ScreenSpaceDrawQuad.TopLeft + 3 * playfield.ScreenSpaceDrawQuad.BottomRight) / 4;
InputManager.MoveMouseTo(location);
});
AddStep("confirm via global action", () =>
{
globalActionContainer.TriggerPressed(GlobalAction.Select);
globalActionContainer.TriggerReleased(GlobalAction.Select);
});
AddStep("confirm via right click", () => InputManager.Click(MouseButton.Right));
AddAssert("slider placed", () => EditorBeatmap.HitObjects.Count, () => Is.EqualTo(1));

AddAssert("slider samples have drum bank", () => EditorBeatmap.HitObjects[0].Samples.All(s => s.Bank == HitSampleInfo.BANK_DRUM));
Expand Down
4 changes: 0 additions & 4 deletions osu.Game/Rulesets/Edit/PlacementBlueprint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)

switch (e.Action)
{
case GlobalAction.Select:
EndPlacement(true);
return true;

case GlobalAction.Back:
EndPlacement(false);
return true;
Expand Down

0 comments on commit 60c1e0f

Please sign in to comment.