diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 036243e668..4fca38a6c6 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -96,7 +96,7 @@ public Editor() }; timeline.Beatmap.BindTo(Beatmap); - menuBar.ModeChanged += onModeChanged; + menuBar.Mode.ValueChanged += onModeChanged; } [BackgroundDependencyLoader] diff --git a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs index 34a96b0a6e..a4348b4489 100644 --- a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs +++ b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs @@ -11,16 +11,14 @@ using osu.Game.Graphics.UserInterface; using OpenTK; using OpenTK.Graphics; +using osu.Framework.Configuration; using osu.Game.Screens.Edit.Screens; namespace osu.Game.Screens.Edit.Menus { public class EditorMenuBar : OsuMenu { - /// - /// Invaoked when the selected mode has changed. - /// - public event Action ModeChanged; + public readonly Bindable Mode = new Bindable(); private readonly ScreenSelectionTabControl tabControl; @@ -42,7 +40,7 @@ public EditorMenuBar() } }); - tabControl.Current.ValueChanged += v => ModeChanged?.Invoke(v); + tabControl.Current.BindTo(Mode); } protected override void LoadComplete()