1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

DefaultBackAction -> BackAction, defaults to last button

The last button is more commonly the escape condition.
This commit is contained in:
Dean Herbert 2018-06-27 12:57:26 +09:00
parent d7ce4ab6fd
commit 0866dd11bd
3 changed files with 6 additions and 7 deletions

View File

@ -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)
{

View File

@ -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;
}

View File

@ -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)
{