mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 21:07:33 +08:00
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 @@ namespace osu.Game.Screens.Edit
|
||||
};
|
||||
|
||||
timeline.Beatmap.BindTo(Beatmap);
|
||||
menuBar.ModeChanged += onModeChanged;
|
||||
menuBar.Mode.ValueChanged += onModeChanged;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
@ -11,16 +11,14 @@ using osu.Game.Graphics;
|
||||
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 @@ namespace osu.Game.Screens.Edit.Menus
|
||||
}
|
||||
});
|
||||
|
||||
tabControl.Current.ValueChanged += v => ModeChanged?.Invoke(v);
|
||||
tabControl.Current.BindTo(Mode);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
Loading…
Reference in New Issue
Block a user