mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Shuffle sound samples around and make more conformant
This commit is contained in:
@ -3,6 +3,8 @@
|
||||
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
@ -18,6 +20,9 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
private Box hover;
|
||||
|
||||
private SampleChannel sampleClick;
|
||||
private SampleChannel sampleHover;
|
||||
|
||||
public OsuButton()
|
||||
{
|
||||
Height = 40;
|
||||
@ -34,7 +39,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
public override bool HandleInput => Action != null;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
private void load(OsuColour colours, AudioManager audio)
|
||||
{
|
||||
if (Action == null)
|
||||
Colour = OsuColour.Gray(0.5f);
|
||||
@ -60,10 +65,20 @@ namespace osu.Game.Graphics.UserInterface
|
||||
Alpha = 0,
|
||||
},
|
||||
});
|
||||
|
||||
sampleClick = audio.Sample.Get(@"UI/generic-click");
|
||||
sampleHover = audio.Sample.Get(@"UI/generic-hover");
|
||||
}
|
||||
|
||||
protected override bool OnClick(InputState state)
|
||||
{
|
||||
sampleClick?.Play();
|
||||
return base.OnClick(state);
|
||||
}
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
sampleHover?.Play();
|
||||
hover.FadeIn(200);
|
||||
return base.OnHover(state);
|
||||
}
|
||||
|
@ -106,8 +106,8 @@ namespace osu.Game.Graphics.UserInterface
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
sampleChecked = audio.Sample.Get(@"Checkbox/check-on");
|
||||
sampleUnchecked = audio.Sample.Get(@"Checkbox/check-off");
|
||||
sampleChecked = audio.Sample.Get(@"UI/check-on");
|
||||
sampleUnchecked = audio.Sample.Get(@"UI/check-off");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,8 +65,8 @@ namespace osu.Game.Graphics.UserInterface
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
sampleHover = audio.Sample.Get(@"Menu/menuclick");
|
||||
sampleClick = audio.Sample.Get(@"Menu/menuback");
|
||||
sampleHover = audio.Sample.Get(@"UI/generic-hover");
|
||||
sampleClick = audio.Sample.Get(@"UI/generic-click");
|
||||
|
||||
BackgroundColour = Color4.Transparent;
|
||||
BackgroundColourHover = OsuColour.FromHex(@"172023");
|
||||
|
@ -100,7 +100,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio, OsuColour colours)
|
||||
{
|
||||
sample = audio.Sample.Get(@"Sliderbar/sliderbar");
|
||||
sample = audio.Sample.Get(@"UI/sliderbar-notch");
|
||||
AccentColour = colours.Pink;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user