mirror of https://github.com/ppy/osu
Use a bindable for the current screen in EditorMenuBar
Replaces the current Action.
This commit is contained in:
parent
34eede0d04
commit
8a52fdc8fa
|
@ -96,7 +96,7 @@ public Editor()
|
|||
};
|
||||
|
||||
timeline.Beatmap.BindTo(Beatmap);
|
||||
menuBar.ModeChanged += onModeChanged;
|
||||
menuBar.Mode.ValueChanged += onModeChanged;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
|
|
@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// Invaoked when the selected mode has changed.
|
||||
/// </summary>
|
||||
public event Action<EditorScreenMode> ModeChanged;
|
||||
public readonly Bindable<EditorScreenMode> Mode = new Bindable<EditorScreenMode>();
|
||||
|
||||
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()
|
||||
|
|
Loading…
Reference in New Issue