From d291103d22e26f68d4c65e28d5c234412ed0be1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 5 Feb 2017 16:34:47 +0100 Subject: [PATCH 1/4] Avoid triangle bleeding by masking the triangle container without smoothness. --- osu.Game/Overlays/Pause/PauseButton.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/Pause/PauseButton.cs b/osu.Game/Overlays/Pause/PauseButton.cs index bb707a70b1..3a6e20c4d9 100644 --- a/osu.Game/Overlays/Pause/PauseButton.cs +++ b/osu.Game/Overlays/Pause/PauseButton.cs @@ -203,13 +203,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) + } + } + }, } } } From c56478e1543e4855118b301c52c22c06b909ea18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 5 Feb 2017 20:16:40 +0100 Subject: [PATCH 2/4] Add missing license header. --- osu.Game/Overlays/Pause/PauseButton.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Overlays/Pause/PauseButton.cs b/osu.Game/Overlays/Pause/PauseButton.cs index 3a6e20c4d9..4da08c99d1 100644 --- a/osu.Game/Overlays/Pause/PauseButton.cs +++ b/osu.Game/Overlays/Pause/PauseButton.cs @@ -1,4 +1,8 @@ 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; From 0f72ef7dc2c900dceb1c0d0ee0bce596c2ea8beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 5 Feb 2017 20:17:02 +0100 Subject: [PATCH 3/4] Make pause buttons OnClick and not OnMouseDown. --- osu.Game/Overlays/Pause/PauseButton.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Pause/PauseButton.cs b/osu.Game/Overlays/Pause/PauseButton.cs index 4da08c99d1..cfbd933cec 100644 --- a/osu.Game/Overlays/Pause/PauseButton.cs +++ b/osu.Game/Overlays/Pause/PauseButton.cs @@ -1,4 +1,3 @@ -using OpenTK; //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE @@ -65,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); @@ -83,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); From 91f09512555d76a7f9667ad73849709746606238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 5 Feb 2017 20:17:29 +0100 Subject: [PATCH 4/4] Handle OnMouseDown in PauseOverlay such that players can not click circles through the overlay while paused. --- osu.Game/Overlays/Pause/PauseOverlay.cs | 3 +++ 1 file changed, 3 insertions(+) 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)