diff --git a/hmm.json b/hmm.json index 9061d594b..e92868545 100644 --- a/hmm.json +++ b/hmm.json @@ -89,7 +89,7 @@ { "name": "json2object", "type": "haxelib", - "version": null + "version": "3.11.0" }, { "name": "lime", @@ -118,4 +118,4 @@ "version": "0.2.2" } ] -} +} \ No newline at end of file diff --git a/source/funkin/audio/SoundGroup.hx b/source/funkin/audio/SoundGroup.hx index df197148b..69c52c3d0 100644 --- a/source/funkin/audio/SoundGroup.hx +++ b/source/funkin/audio/SoundGroup.hx @@ -79,6 +79,10 @@ class SoundGroup extends FlxTypedGroup result.pause(); result.time = this.time; + result.onComplete = function() { + this.onComplete(); + } + // Apply parameters to the new sound. result.pitch = this.pitch; result.volume = this.volume; @@ -86,6 +90,8 @@ class SoundGroup extends FlxTypedGroup return result; } + public dynamic function onComplete():Void {} + /** * Pause all the sounds in the group. */ diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 4698c7e7e..047a1b5fe 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -1093,7 +1093,7 @@ class PlayState extends MusicBeatState // TODO: Fix grouped vocals vocals = currentChart.buildVocals(); - vocals.members[0].onComplete = function() { + vocals.onComplete = function() { vocalsFinished = true; } diff --git a/source/funkin/play/song/Song.hx b/source/funkin/play/song/Song.hx index 93f7d42a3..a712de1cc 100644 --- a/source/funkin/play/song/Song.hx +++ b/source/funkin/play/song/Song.hx @@ -305,7 +305,7 @@ class SongDifficulty public inline function playInst(volume:Float = 1.0, looped:Bool = false):Void { - var suffix:String = variation == null ? null : '-$variation'; + var suffix:String = (variation ?? '') != '' ? '-$variation' : ''; FlxG.sound.playMusic(Paths.inst(this.song.songId, suffix), volume, looped); } @@ -336,7 +336,7 @@ class SongDifficulty return []; } - var suffix:String = variation != null ? '-$variation' : ''; + var suffix:String = (variation ?? '') != '' ? '-$variation' : ''; // Automatically resolve voices by removing suffixes. // For example, if `Voices-bf-car.ogg` does not exist, check for `Voices-bf.ogg`.