mirror of
https://github.com/ppy/osu
synced 2025-01-19 04:20:59 +00:00
Merge remote-tracking branch 'upstream/master' into peppy/pause-clean-up
# Conflicts: # osu.Game/Screens/Play/FailOverlay.cs # osu.Game/Screens/Play/PauseOverlay.cs
This commit is contained in:
commit
9bf861d0a4
@ -1 +1 @@
|
||||
Subproject commit 34ac837eebeecd0b6f35829780f2123f6b8cc698
|
||||
Subproject commit 2234013e59a99116ee9f9e56a95ff8a6667db2a7
|
@ -13,6 +13,7 @@ using osu.Framework.Graphics.OpenGL.Buffers;
|
||||
using OpenTK.Graphics.ES30;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Timing;
|
||||
|
||||
namespace osu.Game.Graphics.Cursor
|
||||
{
|
||||
@ -58,6 +59,9 @@ namespace osu.Game.Graphics.Cursor
|
||||
|
||||
public CursorTrail()
|
||||
{
|
||||
// as we are currently very dependent on having a running clock, let's make our own clock for the time being.
|
||||
Clock = new FramedClock();
|
||||
|
||||
AlwaysReceiveInput = true;
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
@ -231,4 +235,4 @@ namespace osu.Game.Graphics.Cursor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,17 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Input;
|
||||
using OpenTK.Input;
|
||||
using osu.Game.Graphics;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using System.Linq;
|
||||
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
public class FailOverlay : MenuOverlay
|
||||
{
|
||||
|
||||
public override string Header => "failed";
|
||||
public override string Description => "you're dead, try again?";
|
||||
|
||||
@ -19,5 +21,16 @@ namespace osu.Game.Screens.Play
|
||||
AddButton("Retry", colours.YellowDark, OnRetry);
|
||||
AddButton("Quit", new Color4(170, 27, 39, 255), OnQuit);
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
{
|
||||
if (!args.Repeat && args.Key == Key.Escape)
|
||||
{
|
||||
Buttons.Children.Last().TriggerClick();
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.OnKeyDown(state, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,10 +13,11 @@ using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
public abstract class MenuOverlay : OverlayContainer
|
||||
public abstract class MenuOverlay : OverlayContainer, IRequireHighFrequencyMousePosition
|
||||
{
|
||||
private const int transition_duration = 200;
|
||||
private const int button_height = 70;
|
||||
@ -30,7 +31,7 @@ namespace osu.Game.Screens.Play
|
||||
public abstract string Header { get; }
|
||||
public abstract string Description { get; }
|
||||
|
||||
private FillFlowContainer buttons;
|
||||
protected FillFlowContainer<DialogButton> Buttons;
|
||||
|
||||
public int Retries
|
||||
{
|
||||
@ -80,11 +81,13 @@ namespace osu.Game.Screens.Play
|
||||
// Don't let mouse down events through the overlay or people can click circles while paused.
|
||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
||||
|
||||
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) => true;
|
||||
|
||||
protected override bool OnMouseMove(InputState state) => true;
|
||||
|
||||
protected void AddButton(string text, Color4 colour, Action action)
|
||||
{
|
||||
buttons.Add(new PauseButton
|
||||
Buttons.Add(new PauseButton
|
||||
{
|
||||
Text = text,
|
||||
ButtonColour = colour,
|
||||
@ -151,7 +154,7 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
}
|
||||
},
|
||||
buttons = new FillFlowContainer
|
||||
Buttons = new FillFlowContainer<DialogButton>
|
||||
{
|
||||
Origin = Anchor.TopCentre,
|
||||
Anchor = Anchor.TopCentre,
|
||||
|
@ -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.Input;
|
||||
using osu.Game.Graphics;
|
||||
using OpenTK.Input;
|
||||
@ -19,10 +20,9 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
{
|
||||
if (args.Repeat) return false;
|
||||
if (args.Key == Key.Escape)
|
||||
if (!args.Repeat && args.Key == Key.Escape)
|
||||
{
|
||||
OnResume();
|
||||
Buttons.Children.First().TriggerClick();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -38,4 +38,3 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user