mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-28 00:04:33 +02:00
Jump Ledge sound plays later depending on speed
This commit is contained in:
parent
1cdb83545e
commit
540186d2ea
Binary file not shown.
@ -174,6 +174,7 @@
|
|||||||
|
|
||||||
MainGameFunctions.FunctionKeys()
|
MainGameFunctions.FunctionKeys()
|
||||||
MusicManager.Update()
|
MusicManager.Update()
|
||||||
|
SoundManager.Update()
|
||||||
|
|
||||||
GameMessage.Update()
|
GameMessage.Update()
|
||||||
|
|
||||||
|
@ -19,7 +19,16 @@
|
|||||||
Screen.Level.OverworldPokemon.Visible = False
|
Screen.Level.OverworldPokemon.Visible = False
|
||||||
Screen.Level.OverworldPokemon.warped = True
|
Screen.Level.OverworldPokemon.warped = True
|
||||||
|
|
||||||
SoundManager.PlaySound("jump_ledge", False)
|
Dim delay As Date = Date.Now
|
||||||
|
If Screen.Level.Riding = True Then
|
||||||
|
delay = Date.Now.AddMilliseconds(401)
|
||||||
|
ElseIf Core.Player.IsRunning() = True Then
|
||||||
|
delay = Date.Now.AddMilliseconds(540)
|
||||||
|
Else
|
||||||
|
delay = Date.Now.AddMilliseconds(867)
|
||||||
|
End If
|
||||||
|
|
||||||
|
SoundManager.PlaySound("jump_ledge", False, delay)
|
||||||
|
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
@ -7,11 +7,28 @@
|
|||||||
Public Shared Volume As Single = 1.0F
|
Public Shared Volume As Single = 1.0F
|
||||||
Public Shared Muted As Boolean = False
|
Public Shared Muted As Boolean = False
|
||||||
|
|
||||||
|
Public Shared DelayedDate As Date = Nothing
|
||||||
|
Public Shared DelayedSound As String = ""
|
||||||
|
Public Shared DelayedStopMusic As Boolean = False
|
||||||
|
|
||||||
Private Declare Function GetAudioOutputDevices Lib "winmm.dll" Alias "waveOutGetNumDevs" () As Integer
|
Private Declare Function GetAudioOutputDevices Lib "winmm.dll" Alias "waveOutGetNumDevs" () As Integer
|
||||||
Private Shared Function HasOutputDeviceAvailable() As Boolean
|
Private Shared Function HasOutputDeviceAvailable() As Boolean
|
||||||
Return GetAudioOutputDevices() > 0
|
Return GetAudioOutputDevices() > 0
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Shared Sub Update()
|
||||||
|
If DelayedDate <> Nothing AndAlso DelayedSound <> "" Then
|
||||||
|
If Date.Now >= DelayedDate Then
|
||||||
|
PlaySound(DelayedSound, 0.0F, 0.0F, Volume, DelayedStopMusic)
|
||||||
|
DelayedDate = Nothing
|
||||||
|
DelayedSound = ""
|
||||||
|
DelayedStopMusic = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Private Shared Function AddSound(ByVal Name As String, ByVal forceReplace As Boolean) As Boolean
|
Private Shared Function AddSound(ByVal Name As String, ByVal forceReplace As Boolean) As Boolean
|
||||||
Try
|
Try
|
||||||
Dim cContent As ContentManager = ContentPackManager.GetContentManager("Sounds\" & Name, ".xnb,.wav")
|
Dim cContent As ContentManager = ContentPackManager.GetContentManager("Sounds\" & Name, ".xnb,.wav")
|
||||||
@ -64,10 +81,28 @@
|
|||||||
Public Shared Sub PlaySound(soundFile As String)
|
Public Shared Sub PlaySound(soundFile As String)
|
||||||
PlaySound(soundFile, 0.0F, 0.0F, Volume, False)
|
PlaySound(soundFile, 0.0F, 0.0F, Volume, False)
|
||||||
End Sub
|
End Sub
|
||||||
|
Public Shared Sub PlaySound(soundFile As String, Optional delay As Date = Nothing)
|
||||||
|
If delay = Nothing OrElse delay = Date.Now Then
|
||||||
|
PlaySound(soundFile, 0.0F, 0.0F, Volume, False)
|
||||||
|
Else
|
||||||
|
DelayedDate = delay
|
||||||
|
DelayedSound = soundFile
|
||||||
|
DelayedStopMusic = False
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Public Shared Sub PlaySound(soundFile As String, stopMusic As Boolean)
|
Public Shared Sub PlaySound(soundFile As String, stopMusic As Boolean)
|
||||||
PlaySound(soundFile, 0.0F, 0.0F, Volume, stopMusic)
|
PlaySound(soundFile, 0.0F, 0.0F, Volume, stopMusic)
|
||||||
End Sub
|
End Sub
|
||||||
|
Public Shared Sub PlaySound(soundFile As String, stopMusic As Boolean, Optional delay As Date = Nothing)
|
||||||
|
If delay = Nothing OrElse delay = Date.Now Then
|
||||||
|
PlaySound(soundFile, 0.0F, 0.0F, Volume, stopMusic)
|
||||||
|
Else
|
||||||
|
DelayedDate = delay
|
||||||
|
DelayedSound = soundFile
|
||||||
|
DelayedStopMusic = stopMusic
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Public Shared Sub PlaySound(soundFile As String, pitch As Single, pan As Single, volume As Single, stopMusic As Boolean)
|
Public Shared Sub PlaySound(soundFile As String, pitch As Single, pan As Single, volume As Single, stopMusic As Boolean)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user