Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
cdwcgt committed Oct 20, 2024
1 parent f485d71 commit b6fcca7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Osu/UI/DrawableOsuRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public DrawableOsuRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod>?
private bool OnPressInGameplayMenu(InputState state)
{
var realmKeyBindings = realm.Realm.All<RealmKeyBinding>()
.Where(b => b.RulesetName == OsuRuleset.SHORT_NAME && b.Variant == 0).Detach()
.Where(b => b.RulesetName == OsuRuleset.SHORT_NAME && b.Variant == 0)
.Detach()
.Where(key => key.GetAction<OsuAction>() == OsuAction.LeftButton || key.GetAction<OsuAction>() == OsuAction.RightButton);

return state.Keyboard.Keys.Any(pressed => realmKeyBindings
Expand Down
9 changes: 9 additions & 0 deletions osu.Game.Tests/Visual/Gameplay/TestScenePause.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,15 @@ public void TestPauseSoundLoop()
AddUntilStep("loop is stopped", () => !getLoop().IsPlaying);
}

[Test]
public void TestPressActionInPauseOverlay()
{
pauseViaPauseGameplayAction();
AddStep("move mouse to Continue", () => InputManager.MoveMouseTo(Player.ChildrenOfType<PauseOverlay>().First().Buttons[0]));
AddStep("press Z", () => InputManager.PressKey(Key.Z));
confirmResumed();
}

private void pauseAndConfirm()
{
pauseViaBackAction();
Expand Down

0 comments on commit b6fcca7

Please sign in to comment.