Fix Music skipping intro and only playing intro

This commit is contained in:
JappaWakka 2024-05-13 19:00:20 +02:00
parent 3d7eb3bd66
commit 14dd28290c
1 changed files with 5 additions and 6 deletions

View File

@ -260,10 +260,6 @@ Public Class MusicManager
Volume = 0F Volume = 0F
_isFadingOut = False _isFadingOut = False
If Playlist.Count > 1 Then
Playlist.RemoveAt(0)
End If
Dim song = Playlist(0) Dim song = Playlist(0)
If Not song Is Nothing Then If Not song Is Nothing Then
@ -439,6 +435,7 @@ Public Class MusicManager
playedSong = battleIntroSong playedSong = battleIntroSong
Else Else
If regularIntroSong IsNot Nothing AndAlso regularIntroSong.Origin = regularLoopSong.Origin Then If regularIntroSong IsNot Nothing AndAlso regularIntroSong.Origin = regularLoopSong.Origin Then
Playlist.Clear()
Playlist.Add(regularIntroSong) Playlist.Add(regularIntroSong)
If regularLoopSong IsNot Nothing Then If regularLoopSong IsNot Nothing Then
Playlist.Add(regularLoopSong) Playlist.Add(regularLoopSong)
@ -446,6 +443,7 @@ Public Class MusicManager
Play(regularIntroSong) Play(regularIntroSong)
playedSong = regularIntroSong playedSong = regularIntroSong
ElseIf regularLoopSong IsNot Nothing Then ElseIf regularLoopSong IsNot Nothing Then
Playlist.Clear()
Playlist.Add(regularLoopSong) Playlist.Add(regularLoopSong)
Play(regularLoopSong) Play(regularLoopSong)
playedSong = regularLoopSong playedSong = regularLoopSong
@ -463,12 +461,13 @@ Public Class MusicManager
_isIntroStarted = False _isIntroStarted = False
_isFadingIn = True _isFadingIn = True
FadeInto(introSong, fadeSpeed) FadeInto(introSong, fadeSpeed)
Playlist.Add(nextSong)
Else Else
_isIntroStarted = True _isIntroStarted = True
_introEndTime = Date.Now + introSong.Duration _introEndTime = Date.Now + introSong.Duration
Play(introSong) Play(introSong)
Playlist.AddRange({introSong, nextSong})
End If End If
Playlist.AddRange({introSong, nextSong})
playedSong = introSong playedSong = introSong
Else Else
_isIntroStarted = False _isIntroStarted = False
@ -491,8 +490,8 @@ Public Class MusicManager
FadeInto(nextSong, fadeSpeed) FadeInto(nextSong, fadeSpeed)
Else Else
Play(nextSong) Play(nextSong)
Playlist.Add(nextSong)
End If End If
Playlist.Add(nextSong)
playedSong = nextSong playedSong = nextSong
End If End If