2016-10-04 18:41:18 +08:00
|
|
|
|
//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.Extensions;
|
|
|
|
|
using osu.Game.GameModes.Play;
|
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using OpenTK.Graphics;
|
2016-10-10 16:17:26 +08:00
|
|
|
|
using osu.Framework;
|
2016-10-04 18:41:18 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays
|
|
|
|
|
{
|
|
|
|
|
public class ToolbarModeButton : ToolbarButton
|
|
|
|
|
{
|
|
|
|
|
private PlayMode mode;
|
|
|
|
|
public PlayMode Mode
|
|
|
|
|
{
|
|
|
|
|
get { return mode; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
mode = value;
|
|
|
|
|
TooltipMain = mode.GetDescription();
|
|
|
|
|
TooltipSub = $"Play some {mode.GetDescription()}";
|
|
|
|
|
Icon = getModeIcon(mode);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool Active
|
|
|
|
|
{
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
//Background.Colour = value ? new Color4(100, 100, 100, 255) : new Color4(20, 20, 20, 255);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private FontAwesome getModeIcon(PlayMode mode)
|
|
|
|
|
{
|
|
|
|
|
switch (mode)
|
|
|
|
|
{
|
|
|
|
|
default: return FontAwesome.fa_osu_osu_o;
|
|
|
|
|
case PlayMode.Taiko: return FontAwesome.fa_osu_taiko_o;
|
|
|
|
|
case PlayMode.Catch: return FontAwesome.fa_osu_fruits_o;
|
|
|
|
|
case PlayMode.Mania: return FontAwesome.fa_osu_mania_o;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 16:17:26 +08:00
|
|
|
|
public override void Load(BaseGame game)
|
2016-10-04 18:41:18 +08:00
|
|
|
|
{
|
2016-10-10 16:17:26 +08:00
|
|
|
|
base.Load(game);
|
2016-10-04 18:41:18 +08:00
|
|
|
|
DrawableIcon.TextSize *= 1.4f;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|