Implemented @Music.ForcePlay command

This commit is contained in:
CaptainSegis 2017-04-14 11:56:35 -05:00
parent b6c85bc77d
commit 39f93def95
2 changed files with 18 additions and 1 deletions

View File

@ -20,6 +20,18 @@
Return Core.Null
End Function
<ScriptCommand("ForcePlay")>
<ScriptDescription("Plays music and sets the music loop ignoring last song and without fade-in.")>
Private Function M_ForcePlay(ByVal argument As String) As String
MusicPlayer.GetInstance().ForcePlay(argument)
If Screen.Level IsNot Nothing Then
Screen.Level.MusicLoop = argument
End If
Return Core.Null
End Function
<ScriptCommand("SetMusicLoop")>
<ScriptDescription("Sets the music loop without playing music.")>
Private Function M_SetMusicLoop(ByVal argument As String) As String

View File

@ -327,7 +327,12 @@ Public Class MusicPlayer
End If
End If
End Sub
Public Sub ForcePlay(ByVal Song As String)
_currentSong = "nomusic"
_introPlaying = False
_introRemaining = TimeSpan.FromSeconds(0)
Play(Song, True, 1, 1)
End Sub
''' <summary>
''' This stops all music playback.
''' </summary>