mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09: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:
@ -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 OpenTK.Graphics;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Transformations;
|
using osu.Framework.Graphics.Transformations;
|
||||||
@ -61,7 +64,7 @@ namespace osu.Game.Overlays.Pause
|
|||||||
|
|
||||||
public override bool Contains(Vector2 screenSpacePos) => backgroundContainer.Contains(screenSpacePos);
|
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;
|
didClick = true;
|
||||||
colourContainer.ResizeTo(new Vector2(1.5f, 1f), clickDuration, EasingTypes.In);
|
colourContainer.ResizeTo(new Vector2(1.5f, 1f), clickDuration, EasingTypes.In);
|
||||||
@ -79,8 +82,6 @@ namespace osu.Game.Overlays.Pause
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnClick(Framework.Input.InputState state) => false;
|
|
||||||
|
|
||||||
protected override bool OnHover(Framework.Input.InputState state)
|
protected override bool OnHover(Framework.Input.InputState state)
|
||||||
{
|
{
|
||||||
colourContainer.ResizeTo(new Vector2(hoverWidth, 1f), hoverDuration, EasingTypes.OutElastic);
|
colourContainer.ResizeTo(new Vector2(hoverWidth, 1f), hoverDuration, EasingTypes.OutElastic);
|
||||||
@ -203,6 +204,13 @@ namespace osu.Game.Overlays.Pause
|
|||||||
EdgeSmoothness = new Vector2(2, 0),
|
EdgeSmoothness = new Vector2(2, 0),
|
||||||
RelativeSizeAxes = Axes.Both
|
RelativeSizeAxes = Axes.Both
|
||||||
},
|
},
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Masking = true,
|
||||||
|
MaskingSmoothness = 0,
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
new Triangles
|
new Triangles
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -211,6 +219,8 @@ namespace osu.Game.Overlays.Pause
|
|||||||
Shear = new Vector2(-0.2f, 0)
|
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 PopIn() => FadeIn(transition_duration, EasingTypes.In);
|
||||||
protected override void PopOut() => FadeOut(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)
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.Key == Key.Escape)
|
if (args.Key == Key.Escape)
|
||||||
|
Reference in New Issue
Block a user