Add support for gapless looping music.
This commit is contained in:
committed by
abcdefg30
parent
9916e4c4ac
commit
9b1cec7712
@@ -162,13 +162,15 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (!SongExists(currentSong) || (CurrentSongIsBackground && IsBackgroundMusicMuted))
|
||||
return;
|
||||
|
||||
Game.Sound.PlayMusicThen(currentSong, () =>
|
||||
{
|
||||
if (!CurrentSongIsBackground && !Game.Settings.Sound.Repeat)
|
||||
currentSong = GetNextSong();
|
||||
Game.Sound.PlayMusicThen(currentSong, PlayNextSong);
|
||||
}
|
||||
|
||||
Play();
|
||||
});
|
||||
void PlayNextSong()
|
||||
{
|
||||
if (!CurrentSongIsBackground)
|
||||
currentSong = GetNextSong();
|
||||
|
||||
Play();
|
||||
}
|
||||
|
||||
public void Play(MusicInfo music)
|
||||
|
||||
Reference in New Issue
Block a user