2017-02-07 12:59:30 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2016-10-04 18:41:18 +08:00
|
|
|
|
|
2016-12-01 18:15:34 +08:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2016-11-14 17:03:20 +08:00
|
|
|
|
using osu.Game.Modes;
|
2016-12-01 18:15:34 +08:00
|
|
|
|
using OpenTK.Graphics;
|
2016-10-04 18:41:18 +08:00
|
|
|
|
|
2016-12-01 13:22:29 +08:00
|
|
|
|
namespace osu.Game.Overlays.Toolbar
|
2016-10-04 18:41:18 +08:00
|
|
|
|
{
|
|
|
|
|
public class ToolbarModeButton : ToolbarButton
|
|
|
|
|
{
|
|
|
|
|
private PlayMode mode;
|
|
|
|
|
public PlayMode Mode
|
|
|
|
|
{
|
|
|
|
|
get { return mode; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
mode = value;
|
2017-03-10 04:37:03 +08:00
|
|
|
|
TooltipMain = Ruleset.GetRuleset(mode).Description;
|
|
|
|
|
TooltipSub = $"Play some {Ruleset.GetRuleset(mode).Description}";
|
2017-01-30 12:35:40 +08:00
|
|
|
|
Icon = Ruleset.GetRuleset(mode).Icon;
|
2016-10-04 18:41:18 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool Active
|
|
|
|
|
{
|
|
|
|
|
set
|
|
|
|
|
{
|
2016-12-01 18:15:34 +08:00
|
|
|
|
if (value)
|
|
|
|
|
{
|
|
|
|
|
DrawableIcon.Colour = Color4.White;
|
|
|
|
|
DrawableIcon.Masking = true;
|
|
|
|
|
DrawableIcon.EdgeEffect = new EdgeEffect
|
|
|
|
|
{
|
|
|
|
|
Type = EdgeEffectType.Glow,
|
|
|
|
|
Colour = new Color4(255, 194, 224, 100),
|
|
|
|
|
Radius = 15,
|
|
|
|
|
Roundness = 15,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
DrawableIcon.Masking = false;
|
|
|
|
|
DrawableIcon.Colour = new Color4(255, 194, 224, 255);
|
|
|
|
|
}
|
2016-10-04 18:41:18 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-13 01:34:36 +08:00
|
|
|
|
protected override void LoadComplete()
|
2016-10-04 18:41:18 +08:00
|
|
|
|
{
|
2016-11-13 01:34:36 +08:00
|
|
|
|
base.LoadComplete();
|
2016-10-04 18:41:18 +08:00
|
|
|
|
DrawableIcon.TextSize *= 1.4f;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|