1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-30 22:22:59 +08:00

Fix incorrect behaviour

This commit is contained in:
Dan Balasescu 2024-12-18 23:19:14 +09:00
parent 5a2cae89ff
commit 159f6025b8
No known key found for this signature in database

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
@ -24,12 +25,20 @@ namespace osu.Game.Screens.OnlinePlay
set => current.Current = value; 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 OsuSpriteText text = null!;
private Circle circle = null!; private Circle circle = null!;
[Resolved] [Resolved]
private OsuColour colours { get; set; } = null!; 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] [BackgroundDependencyLoader]
private void load() private void load()
{ {
@ -70,9 +79,6 @@ namespace osu.Game.Screens.OnlinePlay
base.LoadComplete(); base.LoadComplete();
Current.BindValueChanged(_ => updateDisplay(), true); 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() private void updateDisplay()