mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Move welcome to local usages
This commit is contained in:
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
|
using osu.Framework.Audio.Sample;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
|
||||||
@ -17,11 +18,13 @@ namespace osu.Game.Screens.Menu
|
|||||||
private const double delay_step_one = 2300;
|
private const double delay_step_one = 2300;
|
||||||
private const double delay_step_two = 600;
|
private const double delay_step_two = 600;
|
||||||
|
|
||||||
|
private SampleChannel welcome;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
if (MenuVoice.Value)
|
if (MenuVoice.Value)
|
||||||
Welcome = audio.Samples.Get(@"welcome");
|
welcome = audio.Samples.Get(@"welcome");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LogoArriving(OsuLogo logo, bool resuming)
|
protected override void LogoArriving(OsuLogo logo, bool resuming)
|
||||||
@ -30,7 +33,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
if (!resuming)
|
if (!resuming)
|
||||||
{
|
{
|
||||||
Welcome?.Play();
|
welcome?.Play();
|
||||||
|
|
||||||
Scheduler.AddDelayed(delegate
|
Scheduler.AddDelayed(delegate
|
||||||
{
|
{
|
||||||
|
@ -37,8 +37,6 @@ namespace osu.Game.Screens.Menu
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected abstract string BeatmapFile { get; }
|
protected abstract string BeatmapFile { get; }
|
||||||
|
|
||||||
protected SampleChannel Welcome;
|
|
||||||
|
|
||||||
protected Bindable<bool> MenuVoice;
|
protected Bindable<bool> MenuVoice;
|
||||||
|
|
||||||
protected Bindable<bool> MenuMusic;
|
protected Bindable<bool> MenuMusic;
|
||||||
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
|
using osu.Framework.Audio.Sample;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -40,11 +41,13 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
private BackgroundScreenDefault background;
|
private BackgroundScreenDefault background;
|
||||||
|
|
||||||
|
private SampleChannel welcome;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
if (MenuVoice.Value && !MenuMusic.Value)
|
if (MenuVoice.Value && !MenuMusic.Value)
|
||||||
Welcome = audio.Samples.Get(@"welcome");
|
welcome = audio.Samples.Get(@"welcome");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LogoArriving(OsuLogo logo, bool resuming)
|
protected override void LogoArriving(OsuLogo logo, bool resuming)
|
||||||
@ -65,7 +68,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
}, t =>
|
}, t =>
|
||||||
{
|
{
|
||||||
AddInternal(t);
|
AddInternal(t);
|
||||||
Welcome?.Play();
|
welcome?.Play();
|
||||||
|
|
||||||
StartTrack();
|
StartTrack();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user