1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 11:35:35 +08:00

Add sound effect to osu! logo clicking.

This commit is contained in:
Dean Herbert 2017-02-07 21:45:59 +09:00
parent 24ba21363e
commit 8a0887c3c3
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49

View File

@ -4,6 +4,8 @@
using System;
using System.Diagnostics;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
@ -32,6 +34,8 @@ namespace osu.Game.Screens.Menu
private Container logoHoverContainer;
private MenuVisualisation vis;
private AudioSample sampleClick;
private Container colourAndTriangles;
public Action Action;
@ -166,8 +170,9 @@ namespace osu.Game.Screens.Menu
}
[BackgroundDependencyLoader]
private void load(TextureStore textures)
private void load(TextureStore textures, AudioManager audio)
{
sampleClick = audio.Sample.Get(@"Menu/menuhit");
logo.Texture = textures.Get(@"Menu/logo");
ripple.Texture = textures.Get(@"Menu/logo");
}
@ -200,6 +205,8 @@ namespace osu.Game.Screens.Menu
{
if (!Interactive) return false;
sampleClick.Play();
flashLayer.ClearTransformations();
flashLayer.Alpha = 0.4f;
flashLayer.FadeOut(1500, EasingTypes.OutExpo);