mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 03:25:11 +08:00
DefaultBackAction -> BackAction, defaults to last button
The last button is more commonly the escape condition.
This commit is contained in:
parent
d7ce4ab6fd
commit
0866dd11bd
@ -1,8 +1,6 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using osu.Game.Graphics;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
@ -14,8 +12,6 @@ namespace osu.Game.Screens.Play
|
||||
public override string Header => "failed";
|
||||
public override string Description => "you're dead, try again?";
|
||||
|
||||
protected override Action DefaultBackAction => () => InternalButtons.Children.Last().TriggerOnClick();
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
|
@ -35,9 +35,9 @@ namespace osu.Game.Screens.Play
|
||||
public Action OnQuit;
|
||||
|
||||
/// <summary>
|
||||
/// Action that is invoked if <see cref="GlobalAction.Back"/> is triggered.
|
||||
/// Action that is invoked when <see cref="GlobalAction.Back"/> is triggered.
|
||||
/// </summary>
|
||||
protected virtual Action DefaultBackAction => () => InternalButtons.Children.First().TriggerOnClick();
|
||||
protected virtual Action BackAction => () => InternalButtons.Children.Last().TriggerOnClick();
|
||||
|
||||
public abstract string Header { get; }
|
||||
public abstract string Description { get; }
|
||||
@ -231,7 +231,7 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
if (action == GlobalAction.Back)
|
||||
{
|
||||
DefaultBackAction.Invoke();
|
||||
BackAction.Invoke();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -135,6 +136,8 @@ namespace osu.Game.Screens.Play
|
||||
public override string Header => "paused";
|
||||
public override string Description => "you're not going to do what i think you're going to do, are ya?";
|
||||
|
||||
protected override Action BackAction => () => InternalButtons.Children.First().TriggerOnClick();
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user