BattleIntro CustomBattleMusic fix

This commit is contained in:
JappaWakkaP3D 2021-10-26 23:43:23 +02:00
parent 1c2b3a94fb
commit 9b8022897c
2 changed files with 24 additions and 26 deletions

View File

@ -523,15 +523,14 @@ Public Class MusicManager
If _songs.ContainsKey(key) = True Then If _songs.ContainsKey(key) = True Then
Return _songs(key) Return _songs(key)
Else Else
If System.IO.File.Exists(gamemodeSongFilePath & ".ogg") = True Or System.IO.File.Exists(defaultSongFilePath & ".ogg") = True Or System.IO.File.Exists(contentSongFilePath & ".ogg") = True Then If System.IO.File.Exists(contentSongFilePath & ".ogg") = True OrElse System.IO.File.Exists(gamemodeSongFilePath & ".ogg") = True Or System.IO.File.Exists(defaultSongFilePath & ".ogg") = True Then
audiotype = ".ogg" audiotype = ".ogg"
ElseIf System.IO.File.Exists(gamemodeSongFilePath & ".mp3") = True Or System.IO.File.Exists(defaultSongFilePath & ".mp3") = True Or System.IO.File.Exists(contentSongFilePath & ".mp3") = True Then ElseIf System.IO.File.Exists(contentSongFilePath & ".mp3") = True OrElse System.IO.File.Exists(gamemodeSongFilePath & ".mp3") = True Or System.IO.File.Exists(defaultSongFilePath & ".mp3") = True Then
audiotype = ".mp3" audiotype = ".mp3"
ElseIf System.IO.File.Exists(gamemodeSongFilePath & ".wma") = True Or System.IO.File.Exists(defaultSongFilePath & ".wma") = True Or System.IO.File.Exists(contentSongFilePath & ".wma") = True Then ElseIf System.IO.File.Exists(contentSongFilePath & ".wma") = True OrElse System.IO.File.Exists(gamemodeSongFilePath & ".wma") = True Or System.IO.File.Exists(defaultSongFilePath & ".wma") = True Then
audiotype = ".wma" audiotype = ".wma"
End If End If
End If End If
If File.Exists(contentSongFilePath & audiotype) Then If File.Exists(contentSongFilePath & audiotype) Then
If AddSong(key, False) = True Then If AddSong(key, False) = True Then
Return _songs(key) Return _songs(key)

View File

@ -23,17 +23,19 @@
Public Sub New(ByVal OldScreen As Screen, ByVal NewScreen As Screen, ByVal IntroType As Integer) Public Sub New(ByVal OldScreen As Screen, ByVal NewScreen As Screen, ByVal IntroType As Integer)
Dim musicLoop As String = Screen.Level.CurrentRegion.Split(CChar(","))(0) & "_wild_intro" Dim musicLoop As String = Screen.Level.CurrentRegion.Split(CChar(","))(0) & "_wild_intro"
If Not BattleSystem.BattleScreen.CustomBattleMusic = "" OrElse MusicManager.SongExists(BattleSystem.BattleScreen.CustomBattleMusic) = True Then
musicLoop = BattleSystem.BattleScreen.CustomBattleMusic & "_intro"
Else
If BattleSystem.BattleScreen.RoamingBattle = True Then If BattleSystem.BattleScreen.RoamingBattle = True Then
If BattleSystem.BattleScreen.RoamingPokemonStorage.MusicLoop <> "" Then If BattleSystem.BattleScreen.RoamingPokemonStorage.MusicLoop <> "" Then
musicLoop = BattleSystem.BattleScreen.RoamingPokemonStorage.MusicLoop & "_intro" musicLoop = BattleSystem.BattleScreen.RoamingPokemonStorage.MusicLoop & "_intro"
End If End If
End If End If
End If
If MusicManager.SongExists(musicLoop) = False Then If MusicManager.SongExists(musicLoop) = False Then
musicLoop = "johto_wild_intro" musicLoop = "johto_wild_intro"
End If End If
musicLoop = musicLoop
Me.Constructor(OldScreen, NewScreen, Nothing, musicLoop, IntroType) Me.Constructor(OldScreen, NewScreen, Nothing, musicLoop, IntroType)
End Sub End Sub
@ -51,9 +53,6 @@
MusicLoop = "johto_wild_intro" MusicLoop = "johto_wild_intro"
End If End If
End If End If
MusicLoop = MusicLoop
Else
MusicLoop = MusicLoop
End If End If
Me.Constructor(OldScreen, NewScreen, Nothing, MusicLoop, IntroType) Me.Constructor(OldScreen, NewScreen, Nothing, MusicLoop, IntroType)
@ -506,6 +505,7 @@
Player.Temp.BeforeBattleFacing = Screen.Camera.GetPlayerFacingDirection() Player.Temp.BeforeBattleFacing = Screen.Camera.GetPlayerFacingDirection()
Dim b As BattleSystem.BattleScreen = CType(Me.NewScreen, BattleSystem.BattleScreen) Dim b As BattleSystem.BattleScreen = CType(Me.NewScreen, BattleSystem.BattleScreen)
If BattleSystem.BattleScreen.CustomBattleMusic = "" OrElse MusicManager.SongExists(BattleSystem.BattleScreen.CustomBattleMusic) = False Then
If b.IsPVPBattle = True Then If b.IsPVPBattle = True Then
MusicManager.Play(MusicLoop, False, 0.0F, False, "pvp") MusicManager.Play(MusicLoop, False, 0.0F, False, "pvp")
Else Else
@ -518,7 +518,6 @@
MusicManager.Play(MusicLoop, False, 0.0F, False, "johto_wild") MusicManager.Play(MusicLoop, False, 0.0F, False, "johto_wild")
End If End If
Else Else
If BattleSystem.BattleScreen.CustomBattleMusic = "" OrElse MusicManager.SongExists(BattleSystem.BattleScreen.CustomBattleMusic) = False Then
If BattleSystem.BattleScreen.RoamingBattle = True AndAlso BattleSystem.BattleScreen.RoamingPokemonStorage.MusicLoop <> "" AndAlso MusicManager.SongExists(BattleSystem.BattleScreen.RoamingPokemonStorage.MusicLoop) = True Then If BattleSystem.BattleScreen.RoamingBattle = True AndAlso BattleSystem.BattleScreen.RoamingPokemonStorage.MusicLoop <> "" AndAlso MusicManager.SongExists(BattleSystem.BattleScreen.RoamingPokemonStorage.MusicLoop) = True Then
MusicManager.Play(MusicLoop, True, 0.0F, False, BattleSystem.BattleScreen.RoamingPokemonStorage.MusicLoop) MusicManager.Play(MusicLoop, True, 0.0F, False, BattleSystem.BattleScreen.RoamingPokemonStorage.MusicLoop)
Else Else
@ -528,11 +527,11 @@
MusicManager.Play(MusicLoop, False, 0.0F, False, "johto_wild") MusicManager.Play(MusicLoop, False, 0.0F, False, "johto_wild")
End If End If
End If End If
End If
End If
Else Else
MusicManager.Play(MusicLoop, True, 0.0F, False, BattleSystem.BattleScreen.CustomBattleMusic) MusicManager.Play(MusicLoop, True, 0.0F, False, BattleSystem.BattleScreen.CustomBattleMusic)
End If End If
End If
End If
If Not MusicLoop Is Nothing Then If Not MusicLoop Is Nothing Then
Me.duration = MusicManager.GetSong(MusicLoop).Duration Me.duration = MusicManager.GetSong(MusicLoop).Duration
Else Else