Add 'swoosh' samples to accentuate MainMenu animations

This commit is contained in:
Jamie Taylor 2023-11-08 22:13:35 +09:00
parent 17aa079cb1
commit f0a1df06ac
No known key found for this signature in database
GPG Key ID: 2ACFA8B6370B8C8C
2 changed files with 13 additions and 1 deletions

View File

@ -86,6 +86,7 @@ namespace osu.Game.Screens.Menu
private readonly List<MainMenuButton> buttonsPlay = new List<MainMenuButton>();
private Sample sampleBackToLogo;
private Sample sampleLogoSwoosh;
private readonly LogoTrackingContainer logoTrackingContainer;
@ -156,6 +157,7 @@ namespace osu.Game.Screens.Menu
if (idleTracker != null) isIdle.BindTo(idleTracker.IsIdle);
sampleBackToLogo = audio.Samples.Get(@"Menu/back-to-logo");
sampleLogoSwoosh = audio.Samples.Get(@"Menu/osu-logo-swoosh");
}
private void onMultiplayer()
@ -263,6 +265,8 @@ namespace osu.Game.Screens.Menu
// Samples are explicitly played here in response to user interaction and not when transitioning due to idle.
sampleBackToLogo?.Play();
sampleLogoSwoosh?.Play();
return true;
case ButtonSystemState.Play:

View File

@ -7,6 +7,8 @@ using System;
using System.Diagnostics;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -89,8 +91,10 @@ namespace osu.Game.Screens.Menu
private SongTicker songTicker;
private Container logoTarget;
private Sample reappearSampleSwoosh;
[BackgroundDependencyLoader(true)]
private void load(BeatmapListingOverlay beatmapListing, SettingsOverlay settings, OsuConfigManager config, SessionStatics statics)
private void load(BeatmapListingOverlay beatmapListing, SettingsOverlay settings, OsuConfigManager config, SessionStatics statics, AudioManager audio)
{
holdDelay = config.GetBindable<double>(OsuSetting.UIHoldActivationDelay);
loginDisplayed = statics.GetBindable<bool>(Static.LoginOverlayDisplayed);
@ -162,6 +166,8 @@ namespace osu.Game.Screens.Menu
Buttons.OnSettings = () => settings?.ToggleVisibility();
Buttons.OnBeatmapListing = () => beatmapListing?.ToggleVisibility();
reappearSampleSwoosh = audio.Samples.Get(@"Menu/reappear-swoosh");
preloadSongSelect();
}
@ -291,6 +297,8 @@ namespace osu.Game.Screens.Menu
{
base.OnResuming(e);
reappearSampleSwoosh?.Play();
ApplyToBackground(b => (b as BackgroundScreenDefault)?.Next());
// we may have consumed our preloaded instance, so let's make another.