Make toolbar buttons more independent logic-wise.

Also adds visual toggle state for toggleable buttons.
This commit is contained in:
Dean Herbert
2016-12-02 18:43:01 +09:00
parent bc2391578c
commit 9bf36418a0
8 changed files with 156 additions and 28 deletions

View File

@ -0,0 +1,23 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
class ToolbarMusicButton : ToolbarToggleButton
{
public ToolbarMusicButton()
{
Icon = FontAwesome.fa_music;
}
[BackgroundDependencyLoader]
private void load(MusicController music)
{
StateContainer = music;
Action = music.ToggleVisibility;
}
}
}