Use GetAsync for all samples

This commit is contained in:
smoogipoo
2018-08-27 17:30:16 +09:00
parent 1b279d383f
commit e7a5816d27
19 changed files with 58 additions and 44 deletions

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Threading.Tasks;
using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Audio;
@ -179,11 +180,11 @@ namespace osu.Game.Screens.Menu
}
[BackgroundDependencyLoader]
private void load(AudioManager audio)
private async Task load(AudioManager audio)
{
sampleHover = audio.Sample.Get(@"Menu/button-hover");
sampleHover = await audio.Sample.GetAsync(@"Menu/button-hover");
if (!string.IsNullOrEmpty(sampleName))
sampleClick = audio.Sample.Get($@"Menu/{sampleName}");
sampleClick = await audio.Sample.GetAsync($@"Menu/{sampleName}");
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)

View File

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Audio;
@ -102,10 +103,10 @@ namespace osu.Game.Screens.Menu
private OsuGame game;
[BackgroundDependencyLoader(true)]
private void load(AudioManager audio, OsuGame game)
private async Task load(AudioManager audio, OsuGame game)
{
this.game = game;
sampleBack = audio.Sample.Get(@"Menu/button-back-select");
sampleBack = await audio.Sample.GetAsync(@"Menu/button-back-select");
}
public bool OnPressed(GlobalAction action)

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Threading.Tasks;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
@ -47,7 +48,7 @@ namespace osu.Game.Screens.Menu
private WorkingBeatmap introBeatmap;
[BackgroundDependencyLoader]
private void load(AudioManager audio, OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game, BindableBeatmap beatmap)
private async Task load(AudioManager audio, OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game, BindableBeatmap beatmap)
{
this.beatmap.BindTo(beatmap);
@ -80,8 +81,8 @@ namespace osu.Game.Screens.Menu
introBeatmap = beatmaps.GetWorkingBeatmap(setInfo.Beatmaps[0]);
track = introBeatmap.Track;
welcome = audio.Sample.Get(@"welcome");
seeya = audio.Sample.Get(@"seeya");
welcome = await audio.Sample.GetAsync(@"welcome");
seeya = await audio.Sample.GetAsync(@"seeya");
}
private const double delay_step_one = 2300;

View File

@ -256,8 +256,8 @@ namespace osu.Game.Screens.Menu
[BackgroundDependencyLoader]
private async Task load(TextureStore textures, AudioManager audio)
{
sampleClick = audio.Sample.Get(@"Menu/osu-logo-select");
sampleBeat = audio.Sample.Get(@"Menu/osu-logo-heartbeat");
sampleClick = await audio.Sample.GetAsync(@"Menu/osu-logo-select");
sampleBeat = await audio.Sample.GetAsync(@"Menu/osu-logo-heartbeat");
logo.Texture = await textures.GetAsync(@"Menu/logo");
ripple.Texture = await textures.GetAsync(@"Menu/logo");