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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user