1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-01 08:59:56 +08:00

Remove bindable to promote one-way access

This commit is contained in:
smoogipoo
2020-04-16 13:25:08 +09:00
Unverified
parent 06e25091f6
commit 9e2be6f2f4
3 changed files with 10 additions and 11 deletions
@@ -2,15 +2,12 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Bindables;
using osu.Framework.Graphics.UserInterface;
namespace osu.Game.Graphics.UserInterface
{
public class OsuMenuItem : MenuItem
{
public readonly Bindable<bool> Enabled = new Bindable<bool>(true);
public readonly MenuItemType Type;
public OsuMenuItem(string text, MenuItemType type = MenuItemType.Standard)
@@ -22,9 +19,6 @@ namespace osu.Game.Graphics.UserInterface
: base(text, action)
{
Type = type;
Enabled.BindValueChanged(enabled => Action.Disabled = !enabled.NewValue);
Action.BindDisabledChanged(disabled => Enabled.Value = !disabled);
}
}
}