Simplify `TriggerClick`s 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 @@ public abstract partial class GameplayMenuOverlay : OverlayContainer, IKeyBindin
/// <summary>
/// Action that is invoked when <see cref="GlobalAction.Back"/> is triggered.
/// </summary>
protected virtual Action BackAction => () => InternalButtons.Children.LastOrDefault()?.TriggerClick();
protected virtual Action BackAction => () => InternalButtons.LastOrDefault()?.TriggerClick();
/// <summary>
/// Action that is invoked when <see cref="GlobalAction.Select"/> is triggered.

View File

@ -28,7 +28,7 @@ public partial class PauseOverlay : GameplayMenuOverlay
private SkinnableSound pauseLoop;
protected override Action BackAction => () => InternalButtons.Children.First().TriggerClick();
protected override Action BackAction => () => InternalButtons.First().TriggerClick();
[BackgroundDependencyLoader]
private void load(OsuColour colours)
@ -64,7 +64,7 @@ public override bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
switch (e.Action)
{
case GlobalAction.PauseGameplay:
InternalButtons.Children.First().TriggerClick();
InternalButtons.First().TriggerClick();
return true;
}