From 159f6025b8a80a4d666506c47833190c0fcdcb71 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 18 Dec 2024 23:19:14 +0900 Subject: [PATCH] Fix incorrect behaviour --- osu.Game/Screens/OnlinePlay/FooterButtonFreePlay.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/OnlinePlay/FooterButtonFreePlay.cs b/osu.Game/Screens/OnlinePlay/FooterButtonFreePlay.cs index 367857e780..bcc7bb787d 100644 --- a/osu.Game/Screens/OnlinePlay/FooterButtonFreePlay.cs +++ b/osu.Game/Screens/OnlinePlay/FooterButtonFreePlay.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Extensions.Color4Extensions; @@ -24,12 +25,20 @@ namespace osu.Game.Screens.OnlinePlay set => current.Current = value; } + public new Action Action { set => throw new NotSupportedException("The click action is handled by the button itself."); } + private OsuSpriteText text = null!; private Circle circle = null!; [Resolved] private OsuColour colours { get; set; } = null!; + public FooterButtonFreePlay() + { + // Overwrite any external behaviour as we delegate the main toggle action to a sub-button. + base.Action = () => current.Value = !current.Value; + } + [BackgroundDependencyLoader] private void load() { @@ -70,9 +79,6 @@ namespace osu.Game.Screens.OnlinePlay base.LoadComplete(); Current.BindValueChanged(_ => updateDisplay(), true); - - // Overwrite any external behaviour as we delegate the main toggle action to a sub-button. - Action = () => current.Value = !current.Value; } private void updateDisplay()