From 6b35898ed9235c5f205aebc4fee3d9693dccb049 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 26 Mar 2024 23:24:59 -0400 Subject: [PATCH 1/5] Fix some issues with Weekend 1. --- assets | 2 +- source/funkin/audio/FunkinSound.hx | 18 +++++++++++------- source/funkin/audio/SoundGroup.hx | 9 ++++++--- source/funkin/audio/VoicesGroup.hx | 2 ++ source/funkin/play/PlayState.hx | 8 +++++--- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/assets b/assets index 5f1726f1b..0a2b524a8 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 5f1726f1b0c11fc747b7473708cf4e5f28be05f1 +Subproject commit 0a2b524a8dd1d94909e2f078dbdcb191e1b55b8c diff --git a/source/funkin/audio/FunkinSound.hx b/source/funkin/audio/FunkinSound.hx index 687860265..6520ff27f 100644 --- a/source/funkin/audio/FunkinSound.hx +++ b/source/funkin/audio/FunkinSound.hx @@ -1,17 +1,18 @@ package funkin.audio; -import flixel.sound.FlxSound; import flixel.group.FlxGroup.FlxTypedGroup; -import flixel.util.FlxSignal.FlxTypedSignal; +import flixel.math.FlxMath; +import flixel.sound.FlxSound; import flixel.system.FlxAssets.FlxSoundAsset; -import funkin.util.tools.ICloneable; +import flixel.tweens.FlxTween; +import flixel.util.FlxSignal.FlxTypedSignal; +import funkin.audio.waveform.WaveformData; +import funkin.audio.waveform.WaveformDataParser; import funkin.data.song.SongData.SongMusicData; import funkin.data.song.SongRegistry; -import funkin.audio.waveform.WaveformData; -import openfl.media.SoundMixer; -import funkin.audio.waveform.WaveformDataParser; -import flixel.math.FlxMath; +import funkin.util.tools.ICloneable; import openfl.Assets; +import openfl.media.SoundMixer; #if (openfl >= "8.0.0") import openfl.utils.AssetType; #end @@ -325,6 +326,7 @@ class FunkinSound extends FlxSound implements ICloneable if (FlxG.sound.music != null) { + FlxG.sound.music.fadeTween?.cancel(); FlxG.sound.music.stop(); FlxG.sound.music.kill(); } @@ -401,6 +403,8 @@ class FunkinSound extends FlxSound implements ICloneable { // trace('[FunkinSound] Destroying sound "${this._label}"'); super.destroy(); + FlxTween.cancelTweensOf(this); + this._label = 'unknown'; } /** diff --git a/source/funkin/audio/SoundGroup.hx b/source/funkin/audio/SoundGroup.hx index 9a754049b..020d5f5bb 100644 --- a/source/funkin/audio/SoundGroup.hx +++ b/source/funkin/audio/SoundGroup.hx @@ -152,9 +152,12 @@ class SoundGroup extends FlxTypedGroup */ public function stop() { - forEachAlive(function(sound:FunkinSound) { - sound.stop(); - }); + if (members != null) + { + forEachAlive(function(sound:FunkinSound) { + sound.stop(); + }); + } } public override function destroy() diff --git a/source/funkin/audio/VoicesGroup.hx b/source/funkin/audio/VoicesGroup.hx index 5daebc89d..91054cfb0 100644 --- a/source/funkin/audio/VoicesGroup.hx +++ b/source/funkin/audio/VoicesGroup.hx @@ -160,7 +160,9 @@ class VoicesGroup extends SoundGroup public override function destroy():Void { playerVoices.destroy(); + playerVoices = null; opponentVoices.destroy(); + opponentVoices = null; super.destroy(); } } diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 169809a63..6dc41e3f9 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -1925,14 +1925,14 @@ class PlayState extends MusicBeatSubState FlxG.sound.music.play(true, startTimestamp - Conductor.instance.instrumentalOffset); FlxG.sound.music.pitch = playbackRate; - // I am going insane. + // Prevent the volume from being wrong. FlxG.sound.music.volume = 1.0; - FlxG.sound.music.fadeTween?.cancel(); trace('Playing vocals...'); add(vocals); vocals.play(); + vocals.volume = 1.0; vocals.pitch = playbackRate; resyncVocals(); @@ -2927,6 +2927,9 @@ class PlayState extends MusicBeatSubState // If the camera is being tweened, stop it. cancelAllCameraTweens(); + // Dispatch the destroy event. + dispatchEvent(new ScriptEvent(DESTROY, false)); + if (currentConversation != null) { remove(currentConversation); @@ -2970,7 +2973,6 @@ class PlayState extends MusicBeatSubState { remove(currentStage); currentStage.kill(); - dispatchEvent(new ScriptEvent(DESTROY, false)); currentStage = null; } From 5ec3546bbc8f25e7131b8de6460720e6ca310fbb Mon Sep 17 00:00:00 2001 From: FabsTheFabs Date: Wed, 27 Mar 2024 04:31:03 +0000 Subject: [PATCH 2/5] fixed song delay and made volume consistent across all tracks --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 5f1726f1b..18af5434e 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 5f1726f1b0c11fc747b7473708cf4e5f28be05f1 +Subproject commit 18af5434e9aaaec5cdd1b20c4cfe11786db303d8 From 4209c5156ee6e211463808d83e0d34ec0769318b Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Wed, 27 Mar 2024 00:39:48 -0400 Subject: [PATCH 3/5] Readd a missing sound in the story menu --- source/funkin/ui/story/StoryMenuState.hx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/funkin/ui/story/StoryMenuState.hx b/source/funkin/ui/story/StoryMenuState.hx index d3aa68c49..5881ef624 100644 --- a/source/funkin/ui/story/StoryMenuState.hx +++ b/source/funkin/ui/story/StoryMenuState.hx @@ -438,6 +438,8 @@ class StoryMenuState extends MusicBeatState } } + FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4); + updateText(); updateBackground(previousLevelId); updateProps(); @@ -481,6 +483,7 @@ class StoryMenuState extends MusicBeatState if (hasChanged) { buildDifficultySprite(); + FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4); // Disable the funny music thing for now. // funnyMusicThing(); } From 982616e2ba1b2338f5bd5e03b1255730f0abba21 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 27 Mar 2024 01:05:53 -0400 Subject: [PATCH 4/5] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 0a2b524a8..90d7bcfaf 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 0a2b524a8dd1d94909e2f078dbdcb191e1b55b8c +Subproject commit 90d7bcfaf9f46303c1b644bd36350de80df9f2c6 From b3076c7ec479f70255155878358fadad3508963e Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 27 Mar 2024 01:07:37 -0400 Subject: [PATCH 5/5] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 18af5434e..fda21459b 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 18af5434e9aaaec5cdd1b20c4cfe11786db303d8 +Subproject commit fda21459bdbf6198c1c39d60e347782d7286eda6