From 41f5e5143af134be4a018f0830c68a90c479c2fa Mon Sep 17 00:00:00 2001 From: mk56-spn Date: Mon, 30 Jan 2023 12:56:39 +0100 Subject: [PATCH] Remove ```onclick``` and ```mousedown``` override --- osu.Game/Screens/Select/FooterV2/FooterButtonV2.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Select/FooterV2/FooterButtonV2.cs b/osu.Game/Screens/Select/FooterV2/FooterButtonV2.cs index 33bf062abb..a4cdf8b71b 100644 --- a/osu.Game/Screens/Select/FooterV2/FooterButtonV2.cs +++ b/osu.Game/Screens/Select/FooterV2/FooterButtonV2.cs @@ -80,11 +80,10 @@ namespace osu.Game.Screens.Select.FooterV2 Size = new Vector2(button_width, button_height); Masking = true; CornerRadius = corner_radius; - InternalChildren = new Drawable[] + Children = new Drawable[] { backgroundBox = new Box { - Colour = colourProvider.Background3, RelativeSizeAxes = Axes.Both }, @@ -142,6 +141,9 @@ namespace osu.Game.Screens.Select.FooterV2 { base.LoadComplete(); + // We want the first colour assignment for the background to be instantaneous + backgroundBox.Colour = Enabled.Value ? colourProvider.Background3 : colourProvider.Background3.Darken(0.3f); + Enabled.BindValueChanged(_ => updateDisplay(), true); OverlayState.BindValueChanged(_ => updateDisplay()); } @@ -156,9 +158,6 @@ namespace osu.Game.Screens.Select.FooterV2 protected override void OnHoverLost(HoverLostEvent e) => updateDisplay(); - protected override bool OnMouseDown(MouseDownEvent e) => !Enabled.Value || base.OnMouseDown(e); - protected override bool OnClick(ClickEvent e) => !Enabled.Value || base.OnClick(e); - public virtual bool OnPressed(KeyBindingPressEvent e) { if (e.Action != Hotkey || e.Repeat) return false;