always use default samples

This commit is contained in:
LeNitrous 2019-09-24 18:17:27 +08:00
parent ec78889e94
commit afa043aa7d
3 changed files with 7 additions and 32 deletions

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Screens;
using osu.Framework.Graphics;
@ -17,10 +18,10 @@ public class IntroCircles : IntroScreen
private const double delay_step_two = 600;
[BackgroundDependencyLoader]
private void load()
private void load(AudioManager audio)
{
if (MenuVoice.Value)
SetWelcome();
Welcome = audio.Samples.Get(@"welcome");
}
protected override void LogoArriving(OsuLogo logo, bool resuming)

View File

@ -9,14 +9,11 @@
using osu.Framework.Graphics;
using osu.Framework.MathUtils;
using osu.Framework.Screens;
using osu.Game.Audio;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.IO.Archives;
using osu.Game.Screens.Backgrounds;
using osu.Game.Skinning;
using osu.Game.Online.API;
using osu.Game.Users;
using osuTK;
using osuTK.Graphics;
@ -51,14 +48,10 @@ public abstract class IntroScreen : StartupScreen
public new Bindable<WorkingBeatmap> Beatmap => beatmap;
protected Bindable<User> User;
protected Bindable<Skin> Skin;
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBlack();
[BackgroundDependencyLoader]
private void load(OsuConfigManager config, IAPIProvider api, SkinManager skinManager, BeatmapManager beatmaps, Framework.Game game)
private void load(OsuConfigManager config, SkinManager skinManager, BeatmapManager beatmaps, Framework.Game game)
{
// prevent user from changing beatmap while the intro is still runnning.
beatmap = base.Beatmap.BeginLease(false);
@ -66,10 +59,7 @@ private void load(OsuConfigManager config, IAPIProvider api, SkinManager skinMan
MenuVoice = config.GetBindable<bool>(OsuSetting.MenuVoice);
MenuMusic = config.GetBindable<bool>(OsuSetting.MenuMusic);
User = api.LocalUser.GetBoundCopy();
Skin = skinManager.CurrentSkin.GetBoundCopy();
Skin.BindValueChanged(_ => updateSeeya(), true);
seeya = audio.Samples.Get(@"seeya");
BeatmapSetInfo setInfo = null;
@ -98,22 +88,6 @@ private void load(OsuConfigManager config, IAPIProvider api, SkinManager skinMan
Track = IntroBeatmap.Track;
}
private void updateSeeya()
{
if (User.Value?.IsSupporter ?? false)
seeya = Skin.Value.GetSample(new SampleInfo("seeya")) ?? audio.Samples.Get(@"seeya");
else
seeya = audio.Samples.Get(@"seeya");
}
protected void SetWelcome()
{
if (User.Value?.IsSupporter ?? false)
Welcome = Skin.Value.GetSample(new SampleInfo("welcome")) ?? audio.Samples.Get(@"welcome");
else
Welcome = audio.Samples.Get(@"welcome");
}
/// <summary>
/// Whether we have loaded the menu previously.
/// </summary>

View File

@ -41,10 +41,10 @@ public class IntroTriangles : IntroScreen
private BackgroundScreenDefault background;
[BackgroundDependencyLoader]
private void load()
private void load(AudioManager audio)
{
if (MenuVoice.Value && !MenuMusic.Value)
SetWelcome();
Welcome = audio.Samples.Get(@"welcome");
}
protected override void LogoArriving(OsuLogo logo, bool resuming)