mirror of
https://github.com/ppy/osu
synced 2025-01-19 04:20:59 +00:00
Fix looping not working
This commit is contained in:
parent
2f15d10029
commit
aabe6c68f5
@ -178,10 +178,6 @@ namespace osu.Game.Screens.Multi.Match
|
||||
|
||||
Beatmap.Disabled = beatmapDisabled;
|
||||
Ruleset.Disabled = rulesetDisabled;
|
||||
|
||||
Beatmap.Value.Track.Looping = true;
|
||||
Beatmap.Value.Track.Seek(Beatmap.Value.Metadata.PreviewTime);
|
||||
Beatmap.Value.Track.Start();
|
||||
}
|
||||
|
||||
private void onStart()
|
||||
|
@ -11,6 +11,7 @@ using osu.Game.Graphics.Backgrounds;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Screens.Menu;
|
||||
using osu.Game.Screens.Multi.Lounge;
|
||||
using osu.Game.Screens.Multi.Match;
|
||||
|
||||
namespace osu.Game.Screens.Multi
|
||||
{
|
||||
@ -76,6 +77,11 @@ namespace osu.Game.Screens.Multi
|
||||
protected override bool OnExiting(Screen next)
|
||||
{
|
||||
waves.Hide();
|
||||
|
||||
var track = Beatmap.Value.Track;
|
||||
if (track != null)
|
||||
track.Looping = false;
|
||||
|
||||
return base.OnExiting(next);
|
||||
}
|
||||
|
||||
@ -102,6 +108,27 @@ namespace osu.Game.Screens.Multi
|
||||
base.LogoExiting(logo);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
if (currentScreen is MatchScreen)
|
||||
{
|
||||
var track = Beatmap.Value.Track;
|
||||
if (track != null)
|
||||
{
|
||||
track.Looping = true;
|
||||
|
||||
if (!track.IsRunning)
|
||||
{
|
||||
Game.Audio.AddItemToList(track);
|
||||
track.Seek(Beatmap.Value.Metadata.PreviewTime);
|
||||
track.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void screenAdded(Screen newScreen)
|
||||
{
|
||||
currentScreen = (OsuScreen)newScreen;
|
||||
@ -112,6 +139,13 @@ namespace osu.Game.Screens.Multi
|
||||
|
||||
private void screenRemoved(Screen newScreen)
|
||||
{
|
||||
if (currentScreen is MatchScreen)
|
||||
{
|
||||
var track = Beatmap.Value.Track;
|
||||
if (track != null)
|
||||
track.Looping = false;
|
||||
}
|
||||
|
||||
currentScreen = (OsuScreen)newScreen;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user