1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-31 05:32:57 +08:00

Fix free mod button overriding enabled state

This commit is contained in:
Dan Balasescu 2024-12-10 23:02:35 +09:00
parent 0fb75233ff
commit 5a2cae89ff
No known key found for this signature in database

View File

@ -36,8 +36,9 @@ namespace osu.Game.Screens.OnlinePlay
} }
} }
private OsuSpriteText count = null!; public new Action Action { set => throw new NotSupportedException("The click action is handled by the button itself."); }
private OsuSpriteText count = null!;
private Circle circle = null!; private Circle circle = null!;
private readonly FreeModSelectOverlay freeModSelectOverlay; private readonly FreeModSelectOverlay freeModSelectOverlay;
@ -45,6 +46,9 @@ namespace osu.Game.Screens.OnlinePlay
public FooterButtonFreeMods(FreeModSelectOverlay freeModSelectOverlay) public FooterButtonFreeMods(FreeModSelectOverlay freeModSelectOverlay)
{ {
this.freeModSelectOverlay = freeModSelectOverlay; this.freeModSelectOverlay = freeModSelectOverlay;
// Overwrite any external behaviour as we delegate the main toggle action to a sub-button.
base.Action = toggleAllFreeMods;
} }
[Resolved] [Resolved]
@ -98,9 +102,6 @@ namespace osu.Game.Screens.OnlinePlay
base.LoadComplete(); base.LoadComplete();
Current.BindValueChanged(_ => updateModDisplay(), true); Current.BindValueChanged(_ => updateModDisplay(), true);
// Overwrite any external behaviour as we delegate the main toggle action to a sub-button.
Action = toggleAllFreeMods;
} }
/// <summary> /// <summary>