1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 14:17:26 +08:00

Add music controller into game.

This commit is contained in:
Huo Yaoyuan 2016-10-28 21:21:47 +08:00
parent 6aba03e1ca
commit 7543d491ae
3 changed files with 16 additions and 5 deletions

View File

@ -25,6 +25,7 @@ namespace osu.Game
{
public Toolbar Toolbar;
public ChatConsole Chat;
public MusicController MusicController;
public MainMenu MainMenu => intro?.ChildGameMode as MainMenu;
private Intro intro;
@ -74,11 +75,13 @@ namespace osu.Game
{
Beatmap = Beatmap
},
MusicController = new MusicController(),
Toolbar = new Toolbar
{
OnHome = delegate { MainMenu?.MakeCurrent(); },
OnSettings = Options.ToggleVisibility,
OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; },
OnMusicController = MusicController.ToggleVisibility,
},
Chat = new ChatConsole(API),
volume = new VolumeControl

View File

@ -35,6 +35,13 @@ namespace osu.Game.Overlays
public MusicController(BeatmapDatabase db = null)
{
database = db;
Width = 400;
Height = 130;
CornerRadius = 5;
Masking = true;
Anchor = Anchor.TopRight;//placeholder
Origin = Anchor.TopRight;
Position = new Vector2(10, 50);
}
public override void Load(BaseGame game)
@ -53,11 +60,6 @@ namespace osu.Game.Overlays
workingChanged();
playList = database.GetAllWithChildren<BeatmapSetInfo>();
Width = 400;
Height = 130;
CornerRadius = 5;
Masking = true;
Children = new Drawable[]
{
backgroundSprite = getScaledSprite(game.Textures.Get(@"Backgrounds/bg4")),//placeholder

View File

@ -22,6 +22,7 @@ namespace osu.Game.Overlays
public Action OnSettings;
public Action OnHome;
public Action<PlayMode> OnPlayModeChange;
public Action OnMusicController;
private ToolbarModeSelector modeSelector;
@ -89,6 +90,11 @@ namespace osu.Game.Overlays
AutoSizeAxes = Axes.X,
Children = new []
{
new ToolbarButton
{
Icon = FontAwesome.music,
Action = OnMusicController
},
new ToolbarButton
{
Icon = FontAwesome.search