Add basic implementation of a toggleable menu item

This commit is contained in:
smoogipoo
2019-11-07 22:26:35 +09:00
parent 29672c48e1
commit c3a3b4091b
5 changed files with 132 additions and 5 deletions

View File

@ -39,7 +39,16 @@ namespace osu.Game.Graphics.UserInterface
}
}
protected override DrawableMenuItem CreateDrawableMenuItem(MenuItem item) => new DrawableOsuMenuItem(item);
protected override DrawableMenuItem CreateDrawableMenuItem(MenuItem item)
{
switch (item)
{
case ToggleMenuItem toggle:
return new DrawableToggleMenuItem(toggle);
}
return new DrawableOsuMenuItem(item);
}
protected override ScrollContainer<Drawable> CreateScrollContainer(Direction direction) => new OsuScrollContainer(direction);