1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 23:47:24 +08:00
osu-lazer/osu.Game/Screens/Play/SkipButton.cs
Thomas Müller 0264c44a20 Do not shadow Colour in TwoLayerButton
Renames Colour to BackgroundColour instead.
2017-02-23 22:33:37 +01:00

47 lines
1.3 KiB
C#

// Copyright (c) 2007-2017 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.Framework.Audio;
using osu.Framework.Graphics;
using osu.Framework.Input;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK.Input;
namespace osu.Game.Screens.Play
{
public class SkipButton : TwoLayerButton
{
public SkipButton()
{
Text = @"Skip";
Icon = FontAwesome.fa_osu_right_o;
Anchor = Anchor.BottomRight;
Origin = Anchor.BottomRight;
}
[BackgroundDependencyLoader]
private void load(AudioManager audio, OsuColour colours)
{
ActivationSound = audio.Sample.Get(@"Menu/menuhit");
BackgroundColour = colours.Yellow;
HoverColour = colours.YellowDark;
}
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
if (args.Repeat) return false;
switch (args.Key)
{
case Key.Space:
TriggerClick();
return true;
}
return base.OnKeyDown(state, args);
}
}
}