allow LOOPSOUND to have volume decay
This commit is contained in:
@@ -1364,7 +1364,9 @@
|
|||||||
(director.stopSound (dictGet sounds name))))
|
(director.stopSound (dictGet sounds name))))
|
||||||
(cc))
|
(cc))
|
||||||
|
|
||||||
(hollywooMethod loopSound [:Bool skipping :String name :Continuation cc &opt :Float volumeMod]
|
(hollywooMethod loopSound [:Bool skipping :String name :Continuation cc &opt :Float volumeMod :Float decay]
|
||||||
|
(unless decay (set decay 0))
|
||||||
|
(localVar &mut vm (+ volumeMod decay))
|
||||||
// Even when skipping, create a lambda that plays an iteration of the sound,
|
// Even when skipping, create a lambda that plays an iteration of the sound,
|
||||||
// so if skipping ends and the sound is still supposed to be looping,
|
// so if skipping ends and the sound is still supposed to be looping,
|
||||||
// we can start it!
|
// we can start it!
|
||||||
@@ -1372,11 +1374,15 @@
|
|||||||
(withFunctions
|
(withFunctions
|
||||||
[
|
[
|
||||||
(:Void playAgain []
|
(:Void playAgain []
|
||||||
|
(-= vm decay)
|
||||||
|
(when (and (> decay 0) (< vm 0))
|
||||||
|
(loopingSoundPlays.remove name)
|
||||||
|
(return))
|
||||||
(playSound false name
|
(playSound false name
|
||||||
(makeCC null
|
(makeCC null
|
||||||
(when (loopingSoundPlays.exists name)
|
(when (loopingSoundPlays.exists name)
|
||||||
(playAgain)))
|
(playAgain)))
|
||||||
volumeMod
|
vm
|
||||||
true))
|
true))
|
||||||
]
|
]
|
||||||
(handleCaption skipping name)
|
(handleCaption skipping name)
|
||||||
|
Reference in New Issue
Block a user