1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-19 11:20:24 +08:00

SongSelectV2: Fix some missing/incorrect SFX

This commit is contained in:
Jamie Taylor
2025-05-30 21:25:36 +09:00
Unverified
parent 9e615718e9
commit cf6e9f8ad8
4 changed files with 20 additions and 8 deletions
@@ -10,7 +10,6 @@ namespace osu.Game.Graphics.UserInterface
{
public partial class ShearedToggleButton : ShearedButton
{
private Sample? sampleClick;
private Sample? sampleOff;
private Sample? sampleOn;
@@ -43,9 +42,8 @@ namespace osu.Game.Graphics.UserInterface
[BackgroundDependencyLoader]
private void load(AudioManager audio)
{
sampleClick = audio.Samples.Get(@"UI/default-select");
sampleOn = audio.Samples.Get(@"UI/dropdown-open");
sampleOff = audio.Samples.Get(@"UI/dropdown-close");
sampleOn = audio.Samples.Get(@"UI/check-on");
sampleOff = audio.Samples.Get(@"UI/check-off");
}
protected override HoverSounds CreateHoverSounds(HoverSampleSet sampleSet) => new HoverSounds(sampleSet);
@@ -72,8 +70,6 @@ namespace osu.Game.Graphics.UserInterface
private void playSample()
{
sampleClick?.Play();
if (PlayToggleSamples)
{
if (Active.Value)
@@ -34,6 +34,8 @@ namespace osu.Game.Graphics.UserInterfaceV2
osuHeader.Dropdown = this;
osuHeader.LeftSideLabel = label;
}
AddInternal(new HoverClickSounds());
}
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
@@ -3,12 +3,15 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays;
using osuTK;
@@ -68,6 +71,8 @@ namespace osu.Game.Screens.SelectV2
protected partial class TabItem : TabItem<T>
{
private Sample? selectSample;
[Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!;
@@ -78,7 +83,7 @@ namespace osu.Game.Screens.SelectV2
{
AutoSizeAxes = Axes.Both;
Children = new[]
Children = new Drawable[]
{
Text = new OsuSpriteText
{
@@ -87,15 +92,24 @@ namespace osu.Game.Screens.SelectV2
Text = value.ToString(),
Font = OsuFont.Style.Body,
},
new HoverSounds(HoverSampleSet.TabSelect)
};
}
[BackgroundDependencyLoader]
private void load(AudioManager audio)
{
selectSample = audio.Samples.Get(@"UI/tabselect-select");
}
protected override void LoadComplete()
{
base.LoadComplete();
updateDisplay();
}
protected override void OnActivatedByUser() => selectSample?.Play();
protected override void OnActivated() => updateDisplay();
protected override void OnDeactivated() => updateDisplay();
@@ -165,7 +165,7 @@ namespace osu.Game.Screens.SelectV2
Colour = colourProvider.Background4,
Font = OsuFont.Style.Caption1.With(weight: FontWeight.Bold),
},
new HoverClickSounds(HoverSampleSet.Button),
new HoverClickSounds(),
};
}