diff --git a/osu.Game/Overlays/Pause/PauseButton.cs b/osu.Game/Overlays/Pause/PauseButton.cs index bb707a70b1..cfbd933cec 100644 --- a/osu.Game/Overlays/Pause/PauseButton.cs +++ b/osu.Game/Overlays/Pause/PauseButton.cs @@ -1,4 +1,7 @@ -using OpenTK; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics; using osu.Framework.Graphics.Transformations; @@ -61,7 +64,7 @@ namespace osu.Game.Overlays.Pause public override bool Contains(Vector2 screenSpacePos) => backgroundContainer.Contains(screenSpacePos); - protected override bool OnMouseDown(Framework.Input.InputState state, MouseDownEventArgs args) + protected override bool OnClick(Framework.Input.InputState state) { didClick = true; colourContainer.ResizeTo(new Vector2(1.5f, 1f), clickDuration, EasingTypes.In); @@ -79,8 +82,6 @@ namespace osu.Game.Overlays.Pause return true; } - protected override bool OnClick(Framework.Input.InputState state) => false; - protected override bool OnHover(Framework.Input.InputState state) { colourContainer.ResizeTo(new Vector2(hoverWidth, 1f), hoverDuration, EasingTypes.OutElastic); @@ -203,13 +204,22 @@ namespace osu.Game.Overlays.Pause EdgeSmoothness = new Vector2(2, 0), RelativeSizeAxes = Axes.Both }, - new Triangles + new Container { RelativeSizeAxes = Axes.Both, - TriangleScale = 4, - ColourDark = OsuColour.Gray(0.88f), - Shear = new Vector2(-0.2f, 0) - } + Masking = true, + MaskingSmoothness = 0, + Children = new[] + { + new Triangles + { + RelativeSizeAxes = Axes.Both, + TriangleScale = 4, + ColourDark = OsuColour.Gray(0.88f), + Shear = new Vector2(-0.2f, 0) + } + } + }, } } } diff --git a/osu.Game/Overlays/Pause/PauseOverlay.cs b/osu.Game/Overlays/Pause/PauseOverlay.cs index 3cf514b7c8..8bf11f98be 100644 --- a/osu.Game/Overlays/Pause/PauseOverlay.cs +++ b/osu.Game/Overlays/Pause/PauseOverlay.cs @@ -69,6 +69,9 @@ namespace osu.Game.Overlays.Pause protected override void PopIn() => FadeIn(transition_duration, EasingTypes.In); protected override void PopOut() => FadeOut(transition_duration, EasingTypes.In); + // 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 OnKeyDown(InputState state, KeyDownEventArgs args) { if (args.Key == Key.Escape)