1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 20:33:11 +08:00

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. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -17,10 +18,10 @@ namespace osu.Game.Screens.Menu
private const double delay_step_two = 600; private const double delay_step_two = 600;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load(AudioManager audio)
{ {
if (MenuVoice.Value) if (MenuVoice.Value)
SetWelcome(); Welcome = audio.Samples.Get(@"welcome");
} }
protected override void LogoArriving(OsuLogo logo, bool resuming) protected override void LogoArriving(OsuLogo logo, bool resuming)

View File

@ -9,14 +9,11 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.MathUtils; using osu.Framework.MathUtils;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Game.Audio;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.IO.Archives; using osu.Game.IO.Archives;
using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Backgrounds;
using osu.Game.Skinning; using osu.Game.Skinning;
using osu.Game.Online.API;
using osu.Game.Users;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
@ -51,14 +48,10 @@ namespace osu.Game.Screens.Menu
public new Bindable<WorkingBeatmap> Beatmap => beatmap; public new Bindable<WorkingBeatmap> Beatmap => beatmap;
protected Bindable<User> User;
protected Bindable<Skin> Skin;
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBlack(); protected override BackgroundScreen CreateBackground() => new BackgroundScreenBlack();
[BackgroundDependencyLoader] [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. // prevent user from changing beatmap while the intro is still runnning.
beatmap = base.Beatmap.BeginLease(false); beatmap = base.Beatmap.BeginLease(false);
@ -66,10 +59,7 @@ namespace osu.Game.Screens.Menu
MenuVoice = config.GetBindable<bool>(OsuSetting.MenuVoice); MenuVoice = config.GetBindable<bool>(OsuSetting.MenuVoice);
MenuMusic = config.GetBindable<bool>(OsuSetting.MenuMusic); MenuMusic = config.GetBindable<bool>(OsuSetting.MenuMusic);
User = api.LocalUser.GetBoundCopy(); seeya = audio.Samples.Get(@"seeya");
Skin = skinManager.CurrentSkin.GetBoundCopy();
Skin.BindValueChanged(_ => updateSeeya(), true);
BeatmapSetInfo setInfo = null; BeatmapSetInfo setInfo = null;
@ -98,22 +88,6 @@ namespace osu.Game.Screens.Menu
Track = IntroBeatmap.Track; 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> /// <summary>
/// Whether we have loaded the menu previously. /// Whether we have loaded the menu previously.
/// </summary> /// </summary>

View File

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