From 2728f34512e31bcf87953dcec6b7e1bc86212d2f Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 7 Nov 2023 18:53:50 -0500 Subject: [PATCH 1/4] Fix bug where Freeplay random would crash the game --- source/funkin/FreeplayState.hx | 14 +++++++++++++- source/funkin/freeplayStuff/LetterSort.hx | 9 +++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/source/funkin/FreeplayState.hx b/source/funkin/FreeplayState.hx index 918e7c725..0ba5d5175 100644 --- a/source/funkin/FreeplayState.hx +++ b/source/funkin/FreeplayState.hx @@ -84,6 +84,7 @@ class FreeplayState extends MusicBeatSubState var dj:DJBoyfriend; + var letterSort:LetterSort; var typing:FlxInputText; var exitMovers:Map, MoveData> = new Map(); @@ -413,7 +414,7 @@ class FreeplayState extends MusicBeatSubState txtCompletion.visible = false; add(txtCompletion); - var letterSort:LetterSort = new LetterSort(400, 75); + letterSort = new LetterSort(400, 75); add(letterSort); letterSort.visible = false; @@ -953,6 +954,7 @@ class FreeplayState extends MusicBeatSubState trace("RANDOM SELECTED"); busy = true; + letterSort.inputEnabled = false; var availableSongCapsules:Array = grpCapsules.members.filter(function(cap:SongMenuItem) { // Dead capsules are ones which were removed from the list when changing filters. @@ -963,6 +965,15 @@ class FreeplayState extends MusicBeatSubState return cap.songData.songName; })}'); + if (availableSongCapsules.length == 0) + { + trace("No songs available!"); + busy = false; + letterSort.inputEnabled = true; + FlxG.sound.play(Paths.sound('cancelMenu')); + return; + } + var targetSong:SongMenuItem = FlxG.random.getObject(availableSongCapsules); // Seeing if I can do an animation... @@ -976,6 +987,7 @@ class FreeplayState extends MusicBeatSubState function capsuleOnConfirmDefault(cap:SongMenuItem):Void { busy = true; + letterSort.inputEnabled = false; PlayStatePlaylist.isStoryMode = false; diff --git a/source/funkin/freeplayStuff/LetterSort.hx b/source/funkin/freeplayStuff/LetterSort.hx index e6d923c90..edf1221d2 100644 --- a/source/funkin/freeplayStuff/LetterSort.hx +++ b/source/funkin/freeplayStuff/LetterSort.hx @@ -23,6 +23,8 @@ class LetterSort extends FlxTypedSpriteGroup var rightArrow:FlxSprite; var grpSeperators:Array = []; + public var inputEnabled:Bool = true; + public function new(x, y) { super(x, y); @@ -72,8 +74,11 @@ class LetterSort extends FlxTypedSpriteGroup { super.update(elapsed); - if (FlxG.keys.justPressed.E) changeSelection(1); - if (FlxG.keys.justPressed.Q) changeSelection(-1); + if (inputEnabled) + { + if (FlxG.keys.justPressed.E) changeSelection(1); + if (FlxG.keys.justPressed.Q) changeSelection(-1); + } } public function changeSelection(diff:Int = 0) From f8ec09b7c257df88241c0a93453faee51bfbfc74 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Thu, 9 Nov 2023 06:28:50 -0500 Subject: [PATCH 2/4] update modules + assets merge --- .gitmodules | 3 +++ assets | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 8968471e3..17c3cc026 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,6 +2,9 @@ path = assets url = https://github.com/FunkinCrew/Funkin-history-rewrite-assets branch = master + update = merge [submodule "art"] path = art url = https://github.com/FunkinCrew/Funkin-history-rewrite-art + branch = master + update = merge diff --git a/assets b/assets index e634c8f50..11a1af02f 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit e634c8f50c34845097283e0f411e1f89409e1498 +Subproject commit 11a1af02fd38ed6086f09bf59567e1efa57b5715 From a9dfd4adcf50aaaad3cfa9bec71540a460bd7c57 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 9 Nov 2023 17:00:46 -0500 Subject: [PATCH 3/4] Fix a bug where multiple vocal tracks would play at once --- source/funkin/play/PlayState.hx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 4542b9f98..0438ffecc 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -700,6 +700,8 @@ class PlayState extends MusicBeatSubState if (!overrideMusic) { + // Stop the vocals if they already exist. + if (vocals != null) vocals.stop(); vocals = currentChart.buildVocals(); if (vocals.members.length == 0) @@ -1554,6 +1556,8 @@ class PlayState extends MusicBeatSubState if (!overrideMusic) { + // Stop the vocals if they already exist. + if (vocals != null) vocals.stop(); vocals = currentChart.buildVocals(); if (vocals.members.length == 0) From 01be0293e3ef16d7c691f9568fb38707750b0631 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Mon, 13 Nov 2023 18:03:24 -0500 Subject: [PATCH 4/4] Revert asset changes (temporarily) --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 11a1af02f..be9d790af 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 11a1af02fd38ed6086f09bf59567e1efa57b5715 +Subproject commit be9d790af9c6f1f5e3afc7aed2b1d5c21823bc20