1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 20:47:26 +08:00

Address issues from Joehuu review

This commit is contained in:
mk56-spn 2022-12-19 11:30:23 +01:00
parent 7373d79ba6
commit 407b0a0ad3
4 changed files with 22 additions and 25 deletions

View File

@ -13,7 +13,7 @@ namespace osu.Game.Screens.Select.FooterV2
private void load(OsuColour colour) private void load(OsuColour colour)
{ {
Text = "Mods"; Text = "Mods";
Icon = FontAwesome.Solid.ArrowsAlt; Icon = FontAwesome.Solid.ExchangeAlt;
AccentColour = colour.Lime1; AccentColour = colour.Lime1;
} }
} }

View File

@ -41,7 +41,7 @@ namespace osu.Game.Screens.Select.FooterV2
{ {
randomSpriteText = new OsuSpriteText randomSpriteText = new OsuSpriteText
{ {
Font = OsuFont.TorusAlternate.With(size: 16), Font = OsuFont.TorusAlternate.With(size: 19),
AlwaysPresent = true, AlwaysPresent = true,
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
@ -49,7 +49,7 @@ namespace osu.Game.Screens.Select.FooterV2
}, },
rewindSpriteText = new OsuSpriteText rewindSpriteText = new OsuSpriteText
{ {
Font = OsuFont.TorusAlternate.With(size: 16), Font = OsuFont.TorusAlternate.With(size: 19),
AlwaysPresent = true, AlwaysPresent = true,
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,

View File

@ -23,12 +23,13 @@ namespace osu.Game.Screens.Select.FooterV2
{ {
public partial class FooterButtonV2 : OsuClickableContainer, IKeyBindingHandler<GlobalAction> public partial class FooterButtonV2 : OsuClickableContainer, IKeyBindingHandler<GlobalAction>
{ {
private const int button_height = 120; private const int button_height = 90;
private const int button_width = 140; private const int button_width = 140;
private const int corner_radius = 10; private const int corner_radius = 10;
private const int transition_length = 500; private const int transition_length = 500;
public const float SHEAR_WIDTH = 16; //Accounts for corner radius margin on bottom, would be 12
public const float SHEAR_WIDTH = 13.5f;
public Bindable<Visibility> OverlayState = new Bindable<Visibility>(); public Bindable<Visibility> OverlayState = new Bindable<Visibility>();
@ -63,7 +64,7 @@ namespace osu.Game.Screens.Select.FooterV2
private SpriteIcon icon = null!; private SpriteIcon icon = null!;
protected Container TextContainer = null!; protected Container TextContainer = null!;
private Box bar = null!; private Box bar = null!;
private Box backGroundBox = null!; private Box backgroundBox = null!;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
@ -81,7 +82,7 @@ namespace osu.Game.Screens.Select.FooterV2
CornerRadius = corner_radius; CornerRadius = corner_radius;
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {
backGroundBox = new Box backgroundBox = new Box
{ {
Colour = colourProvider.Background3, Colour = colourProvider.Background3,
RelativeSizeAxes = Axes.Both RelativeSizeAxes = Axes.Both
@ -90,6 +91,8 @@ namespace osu.Game.Screens.Select.FooterV2
//For elements that should not be sheared. //For elements that should not be sheared.
new Container new Container
{ {
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Shear = -SHEAR, Shear = -SHEAR,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
@ -98,18 +101,18 @@ namespace osu.Game.Screens.Select.FooterV2
{ {
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Position = new Vector2(-SHEAR_WIDTH * (52f / button_height), 42), Y = 42,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Child = text = new OsuSpriteText Child = text = new OsuSpriteText
{ {
Font = OsuFont.TorusAlternate.With(size: 16), //figma design says the size is 16, but due to the issues with font sizes 19 matches better
Font = OsuFont.TorusAlternate.With(size: 19),
AlwaysPresent = true AlwaysPresent = true
} }
}, },
icon = new SpriteIcon icon = new SpriteIcon
{ {
//We want to offset this by the same amount as the text for aesthetic purposes Y = 12,
Position = new Vector2(-SHEAR_WIDTH * (52f / button_height), 12),
Size = new Vector2(20), Size = new Vector2(20),
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre Origin = Anchor.TopCentre
@ -117,7 +120,7 @@ namespace osu.Game.Screens.Select.FooterV2
new Container new Container
{ {
//Offset the bar to centre it with consideration for the shearing //Offset the bar to centre it with consideration for the shearing
Position = new Vector2(-SHEAR_WIDTH * (80f / button_height), -40), Position = new Vector2(-0.15f * 35, -10),
Anchor = Anchor.BottomCentre, Anchor = Anchor.BottomCentre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Size = new Vector2(120, 6), Size = new Vector2(120, 6),
@ -136,6 +139,7 @@ namespace osu.Game.Screens.Select.FooterV2
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
Enabled.BindValueChanged(_ => updateDisplay(), true); Enabled.BindValueChanged(_ => updateDisplay(), true);
OverlayState.BindValueChanged(_ => updateDisplay()); OverlayState.BindValueChanged(_ => updateDisplay());
} }
@ -190,23 +194,23 @@ namespace osu.Game.Screens.Select.FooterV2
{ {
if (!Enabled.Value) if (!Enabled.Value)
{ {
backGroundBox.FadeColour(colourProvider.Background3.Darken(0.3f), transition_length, Easing.OutQuint); backgroundBox.FadeColour(colourProvider.Background3.Darken(0.3f), transition_length, Easing.OutQuint);
return; return;
} }
switch (OverlayState.Value) switch (OverlayState.Value)
{ {
case Visibility.Visible: case Visibility.Visible:
backGroundBox.FadeColour(buttonAccentColour.Darken(0.5f), transition_length, Easing.OutQuint); backgroundBox.FadeColour(buttonAccentColour.Darken(0.5f), transition_length, Easing.OutQuint);
return; return;
case Visibility.Hidden: case Visibility.Hidden:
backGroundBox.FadeColour(buttonAccentColour, transition_length, Easing.OutQuint); backgroundBox.FadeColour(buttonAccentColour, transition_length, Easing.OutQuint);
break; break;
} }
//Hover logic. //Hover logic.
backGroundBox.FadeColour(isHovered && Enabled.Value ? colourProvider.Background3.Lighten(.3f) : colourProvider.Background3, transition_length, Easing.OutQuint); backgroundBox.FadeColour(isHovered && Enabled.Value ? colourProvider.Background3.Lighten(.3f) : colourProvider.Background3, transition_length, Easing.OutQuint);
} }
} }
} }

View File

@ -6,14 +6,13 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osuTK; using osuTK;
namespace osu.Game.Screens.Select.FooterV2 namespace osu.Game.Screens.Select.FooterV2
{ {
public partial class FooterV2 : Container public partial class FooterV2 : InputBlockingContainer
{ {
//Should be 60, setting to 50 for now for the sake of matching the current BackButton height. //Should be 60, setting to 50 for now for the sake of matching the current BackButton height.
private const int height = 50; private const int height = 50;
@ -62,7 +61,7 @@ namespace osu.Game.Screens.Select.FooterV2
{ {
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Position = new Vector2(TwoLayerButton.SIZE_EXTENDED.X + padding, 40), Position = new Vector2(TwoLayerButton.SIZE_EXTENDED.X + padding, 10),
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X, AutoSizeAxes = Axes.X,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
@ -81,11 +80,5 @@ namespace osu.Game.Screens.Select.FooterV2
} }
}; };
} }
protected override bool OnMouseDown(MouseDownEvent e) => true;
protected override bool OnClick(ClickEvent e) => true;
protected override bool OnHover(HoverEvent e) => true;
} }
} }