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
|
2017-01-27 20:57:22 +08:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Audio;
|
|
|
|
|
using osu.Framework.Graphics;
|
2017-02-22 20:28:40 +08:00
|
|
|
|
using osu.Framework.Input;
|
2017-01-27 20:57:22 +08:00
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
2017-02-22 20:28:40 +08:00
|
|
|
|
using OpenTK.Input;
|
2017-01-27 20:57:22 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play
|
|
|
|
|
{
|
|
|
|
|
public class SkipButton : TwoLayerButton
|
|
|
|
|
{
|
|
|
|
|
private readonly double skipDestination;
|
|
|
|
|
|
|
|
|
|
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");
|
|
|
|
|
Colour = colours.Yellow;
|
|
|
|
|
HoverColour = colours.YellowDark;
|
|
|
|
|
}
|
2017-02-22 20:28:40 +08:00
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
2017-01-27 20:57:22 +08:00
|
|
|
|
}
|
|
|
|
|
}
|