1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 14:13:01 +08:00

Fix bindable binding to make the editor load a screen by default again

This commit is contained in:
smoogipoo 2017-10-07 01:42:45 +09:00
parent 837d1ba12e
commit 38ae9d905e

View File

@ -20,8 +20,6 @@ namespace osu.Game.Screens.Edit.Menus
{ {
public readonly Bindable<EditorScreenMode> Mode = new Bindable<EditorScreenMode>(); public readonly Bindable<EditorScreenMode> Mode = new Bindable<EditorScreenMode>();
private readonly ScreenSelectionTabControl tabControl;
public EditorMenuBar() public EditorMenuBar()
: base(Direction.Horizontal, true) : base(Direction.Horizontal, true)
{ {
@ -31,6 +29,7 @@ namespace osu.Game.Screens.Edit.Menus
ItemsContainer.Padding = new MarginPadding { Left = 100 }; ItemsContainer.Padding = new MarginPadding { Left = 100 };
BackgroundColour = OsuColour.FromHex("111"); BackgroundColour = OsuColour.FromHex("111");
ScreenSelectionTabControl tabControl;
AddRangeInternal(new Drawable[] AddRangeInternal(new Drawable[]
{ {
tabControl = new ScreenSelectionTabControl tabControl = new ScreenSelectionTabControl
@ -41,13 +40,13 @@ namespace osu.Game.Screens.Edit.Menus
} }
}); });
tabControl.Current.BindTo(Mode); Mode.BindTo(tabControl.Current);
} }
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
tabControl.Current.TriggerChange(); Mode.TriggerChange();
} }
protected override Framework.Graphics.UserInterface.Menu CreateSubMenu() => new SubMenu(); protected override Framework.Graphics.UserInterface.Menu CreateSubMenu() => new SubMenu();