mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Add menu button sound effects.
This commit is contained in:
@ -2,6 +2,9 @@
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
@ -58,6 +61,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
private SpriteText tooltip1;
|
||||
private SpriteText tooltip2;
|
||||
protected FlowContainer Flow;
|
||||
private AudioSample sampleClick;
|
||||
|
||||
public ToolbarButton()
|
||||
{
|
||||
@ -120,6 +124,12 @@ namespace osu.Game.Overlays.Toolbar
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
sampleClick = audio.Sample.Get(@"Menu/menuclick");
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
@ -133,6 +143,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
protected override bool OnClick(InputState state)
|
||||
{
|
||||
Action?.Invoke();
|
||||
sampleClick.Play();
|
||||
HoverBackground.FlashColour(new Color4(255, 255, 255, 100), 500, EasingTypes.OutQuint);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user