mirror of
https://github.com/ppy/osu.git
synced 2024-12-16 03:42:58 +08:00
Merge pull request #318 from Tom94/minor-pause-visuals
Avoid triangle bleeding by masking the triangle container without smo…
This commit is contained in:
commit
4c2c0b1d49
@ -1,4 +1,7 @@
|
||||
using OpenTK;
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//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)
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user