Simplify TriggerClicks in gameplay menu overlays

This commit is contained in:
Joseph Madamba 2023-01-17 00:34:52 -08:00
parent 8f7cb18217
commit da0eb9b0cb
2 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ namespace osu.Game.Screens.Play
/// <summary> /// <summary>
/// Action that is invoked when <see cref="GlobalAction.Back"/> is triggered. /// Action that is invoked when <see cref="GlobalAction.Back"/> is triggered.
/// </summary> /// </summary>
protected virtual Action BackAction => () => InternalButtons.Children.LastOrDefault()?.TriggerClick(); protected virtual Action BackAction => () => InternalButtons.LastOrDefault()?.TriggerClick();
/// <summary> /// <summary>
/// Action that is invoked when <see cref="GlobalAction.Select"/> is triggered. /// Action that is invoked when <see cref="GlobalAction.Select"/> is triggered.

View File

@ -28,7 +28,7 @@ namespace osu.Game.Screens.Play
private SkinnableSound pauseLoop; private SkinnableSound pauseLoop;
protected override Action BackAction => () => InternalButtons.Children.First().TriggerClick(); protected override Action BackAction => () => InternalButtons.First().TriggerClick();
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
@ -64,7 +64,7 @@ namespace osu.Game.Screens.Play
switch (e.Action) switch (e.Action)
{ {
case GlobalAction.PauseGameplay: case GlobalAction.PauseGameplay:
InternalButtons.Children.First().TriggerClick(); InternalButtons.First().TriggerClick();
return true; return true;
} }