mirror of
https://github.com/ppy/osu.git
synced 2025-03-20 07:17:31 +08:00
Merge remote-tracking branch 'refs/remotes/ppy/master' into requests-expanded
This commit is contained in:
commit
2e3deb46d5
@ -22,8 +22,8 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
Child = button = new TwoLayerButton
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
Anchor = Anchor.TopLeft,
|
||||
Origin = Anchor.TopLeft,
|
||||
Text = @"back",
|
||||
Icon = OsuIcon.LeftCircle,
|
||||
Action = () => Action?.Invoke()
|
||||
|
@ -15,6 +15,7 @@ using System;
|
||||
using osu.Framework.Graphics.Effects;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Screens.Select;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
@ -28,7 +29,9 @@ namespace osu.Game.Graphics.UserInterface
|
||||
private const int transform_time = 600;
|
||||
private const int pulse_length = 250;
|
||||
|
||||
private const float shear = 0.1f;
|
||||
private const float shear_width = 5f;
|
||||
|
||||
private static readonly Vector2 shear = new Vector2(shear_width / Footer.HEIGHT, 0);
|
||||
|
||||
public static readonly Vector2 SIZE_EXTENDED = new Vector2(140, 50);
|
||||
public static readonly Vector2 SIZE_RETRACTED = new Vector2(100, 50);
|
||||
@ -56,7 +59,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
c1.Origin = c1.Anchor = value.HasFlag(Anchor.x2) ? Anchor.TopLeft : Anchor.TopRight;
|
||||
c2.Origin = c2.Anchor = value.HasFlag(Anchor.x2) ? Anchor.TopRight : Anchor.TopLeft;
|
||||
|
||||
X = value.HasFlag(Anchor.x2) ? SIZE_RETRACTED.X * shear * 0.5f : 0;
|
||||
X = value.HasFlag(Anchor.x2) ? SIZE_RETRACTED.X * shear.X * 0.5f : 0;
|
||||
|
||||
Remove(c1);
|
||||
Remove(c2);
|
||||
@ -70,6 +73,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
public TwoLayerButton()
|
||||
{
|
||||
Size = SIZE_RETRACTED;
|
||||
Shear = shear;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@ -82,7 +86,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Shear = new Vector2(shear, 0),
|
||||
Masking = true,
|
||||
MaskingSmoothness = 2,
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
@ -105,6 +108,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Shear = -shear,
|
||||
},
|
||||
}
|
||||
},
|
||||
@ -119,7 +123,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Shear = new Vector2(shear, 0),
|
||||
Masking = true,
|
||||
MaskingSmoothness = 2,
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
@ -144,6 +147,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
Shear = -shear,
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -188,7 +192,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
var flash = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Shear = new Vector2(shear, 0),
|
||||
Colour = Color4.White.Opacity(0.5f),
|
||||
};
|
||||
Add(flash);
|
||||
|
@ -94,7 +94,7 @@ namespace osu.Game.Screens.Select
|
||||
buttons = new FillFlowContainer<FooterButton>
|
||||
{
|
||||
Direction = FillDirection.Horizontal,
|
||||
Spacing = new Vector2(0.2f, 0),
|
||||
Spacing = new Vector2(-FooterButton.SHEAR_WIDTH, 0),
|
||||
AutoSizeAxes = Axes.Both,
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,9 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
public class FooterButton : OsuClickableContainer
|
||||
{
|
||||
private static readonly Vector2 shearing = new Vector2(0.15f, 0);
|
||||
public static readonly float SHEAR_WIDTH = 7.5f;
|
||||
|
||||
protected static readonly Vector2 SHEAR = new Vector2(SHEAR_WIDTH / Footer.HEIGHT, 0);
|
||||
|
||||
public string Text
|
||||
{
|
||||
@ -59,37 +61,35 @@ namespace osu.Game.Screens.Select
|
||||
private readonly Box box;
|
||||
private readonly Box light;
|
||||
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => box.ReceivePositionalInputAt(screenSpacePos);
|
||||
|
||||
public FooterButton()
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
Shear = SHEAR;
|
||||
Children = new Drawable[]
|
||||
{
|
||||
TextContainer = new Container
|
||||
{
|
||||
Size = new Vector2(100, 50),
|
||||
Child = SpriteText = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
}
|
||||
},
|
||||
box = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Shear = shearing,
|
||||
EdgeSmoothness = new Vector2(2, 0),
|
||||
Colour = Color4.White,
|
||||
Alpha = 0,
|
||||
},
|
||||
light = new Box
|
||||
{
|
||||
Shear = shearing,
|
||||
Height = 4,
|
||||
EdgeSmoothness = new Vector2(2, 0),
|
||||
RelativeSizeAxes = Axes.X,
|
||||
},
|
||||
TextContainer = new Container
|
||||
{
|
||||
Size = new Vector2(100 - SHEAR_WIDTH, 50),
|
||||
Shear = -SHEAR,
|
||||
Child = SpriteText = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
Shear = -SHEAR,
|
||||
Child = modDisplay = new FooterModDisplay
|
||||
{
|
||||
DisplayUnrankedText = false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user