Skip to content

Commit

Permalink
implement the sound
Browse files Browse the repository at this point in the history
  • Loading branch information
normalid-awa committed Nov 15, 2024
1 parent ccf1acc commit c9eb754
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions osu.Game/Screens/Menu/OsuLogo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
using osu.Framework.Graphics.Textures;
using osu.Framework.Input.Events;
using osu.Framework.Utils;
using osu.Game.Audio;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Containers;
using osu.Game.Overlays;
using osu.Game.Skinning;
using osuTK;
using osuTK.Graphics;
using osuTK.Input;
Expand Down Expand Up @@ -53,8 +55,8 @@ public partial class OsuLogo : BeatSyncedContainer
private Sample sampleClick;
private SampleChannel sampleClickChannel;

private Sample sampleBeat;
private Sample sampleDownbeat;
private ISample sampleBeat;
private ISample sampleDownbeat;

private readonly Container colourAndTriangles;
private readonly TrianglesV2 triangles;
Expand Down Expand Up @@ -268,11 +270,18 @@ void runnableAction()
}

[BackgroundDependencyLoader]
private void load(TextureStore textures, AudioManager audio)
private void load(TextureStore textures, AudioManager audio, SkinManager skinManager)
{
skinManager.CurrentSkin.BindValueChanged(v =>
{
ISample skinnedNormalHitSound = v.NewValue.GetSample(new HitSampleInfo(HitSampleInfo.HIT_NORMAL, HitSampleInfo.BANK_NORMAL));
ISample skinnedStrongHitSound = v.NewValue.GetSample(new HitSampleInfo(HitSampleInfo.HIT_CLAP, HitSampleInfo.BANK_DRUM));
sampleBeat = skinnedNormalHitSound ?? audio.Samples.Get(@"Menu/osu-logo-heartbeat");
sampleDownbeat = skinnedStrongHitSound ?? audio.Samples.Get(@"Menu/osu-logo-downbeat");
}, true);

sampleClick = audio.Samples.Get(@"Menu/osu-logo-select");
sampleBeat = audio.Samples.Get(@"Menu/osu-logo-heartbeat");
sampleDownbeat = audio.Samples.Get(@"Menu/osu-logo-downbeat");

logo.Texture = textures.Get(@"Menu/logo");
ripple.Texture = textures.Get(@"Menu/logo");
Expand Down

0 comments on commit c9eb754

Please sign in to comment.