mirror of
https://github.com/ppy/osu.git
synced 2025-02-25 20:23:23 +08:00
Add skinning support for "seeya" sample
This commit is contained in:
parent
b8ee786d77
commit
2c1589e068
@ -13,14 +13,17 @@ using osu.Framework.Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.IO.Archives;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using Realms;
|
||||
@ -55,7 +58,8 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
private const int exit_delay = 3000;
|
||||
|
||||
private Sample seeya;
|
||||
private SkinnableSound skinnableSeeya;
|
||||
private ISample seeya;
|
||||
|
||||
protected virtual string SeeyaSampleName => "Intro/seeya";
|
||||
|
||||
@ -90,13 +94,17 @@ namespace osu.Game.Screens.Menu
|
||||
private BeatmapManager beatmaps { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config, Framework.Game game, RealmAccess realm)
|
||||
private void load(OsuConfigManager config, Framework.Game game, RealmAccess realm, IAPIProvider api)
|
||||
{
|
||||
// prevent user from changing beatmap while the intro is still running.
|
||||
beatmap = Beatmap.BeginLease(false);
|
||||
|
||||
MenuVoice = config.GetBindable<bool>(OsuSetting.MenuVoice);
|
||||
MenuMusic = config.GetBindable<bool>(OsuSetting.MenuMusic);
|
||||
|
||||
if (api.LocalUser.Value.IsSupporter)
|
||||
AddInternal(skinnableSeeya = new SkinnableSound(new SampleInfo(SeeyaSampleName)));
|
||||
else
|
||||
seeya = audio.Samples.Get(SeeyaSampleName);
|
||||
|
||||
// if the user has requested not to play theme music, we should attempt to find a random beatmap from their collection.
|
||||
@ -201,7 +209,14 @@ namespace osu.Game.Screens.Menu
|
||||
// we also handle the exit transition.
|
||||
if (MenuVoice.Value)
|
||||
{
|
||||
// ensure samples have been updated after resume before playing.
|
||||
ScheduleAfterChildren(() =>
|
||||
{
|
||||
if (skinnableSeeya != null)
|
||||
skinnableSeeya.Play();
|
||||
else
|
||||
seeya.Play();
|
||||
});
|
||||
|
||||
// if playing the outro voice, we have more time to have fun with the background track.
|
||||
// initially fade to almost silent then ramp out over the remaining time.
|
||||
|
Loading…
Reference in New Issue
Block a user