Merge pull request #3102 from peppy/add-skip-button-sound

Add more prominent sound when skipping
This commit is contained in:
Dan Balasescu
2018-07-30 18:05:09 +09:00
committed by GitHub

View File

@ -4,6 +4,8 @@
using System; using System;
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Threading; using osu.Framework.Threading;
@ -214,17 +216,21 @@ namespace osu.Game.Screens.Play
private Box background; private Box background;
private AspectContainer aspect; private AspectContainer aspect;
private SampleChannel sampleConfirm;
public Button() public Button()
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours, AudioManager audio)
{ {
colourNormal = colours.Yellow; colourNormal = colours.Yellow;
colourHover = colours.YellowDark; colourHover = colours.YellowDark;
sampleConfirm = audio.Sample.Get(@"SongSelect/confirm-selection");
Children = new Drawable[] Children = new Drawable[]
{ {
background = new Box background = new Box
@ -311,6 +317,8 @@ namespace osu.Game.Screens.Play
if (!Enabled) if (!Enabled)
return false; return false;
sampleConfirm.Play();
box.FlashColour(Color4.White, 500, Easing.OutQuint); box.FlashColour(Color4.White, 500, Easing.OutQuint);
aspect.ScaleTo(1.2f, 2000, Easing.OutQuint); aspect.ScaleTo(1.2f, 2000, Easing.OutQuint);