Merge branch 'rewrite/master' into bugfix/cleanup

This commit is contained in:
Cameron Taylor 2023-11-14 15:31:54 -05:00
commit dbeb2a1a1e
4 changed files with 26 additions and 3 deletions

2
.gitmodules vendored
View file

@ -2,7 +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

View file

@ -704,6 +704,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)
@ -1558,6 +1560,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)

View file

@ -90,6 +90,7 @@ class FreeplayState extends MusicBeatSubState
var dj:DJBoyfriend;
var letterSort:LetterSort;
var typing:FlxInputText;
var exitMovers:Map<Array<FlxSprite>, MoveData> = new Map();
@ -419,7 +420,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;
@ -959,6 +960,7 @@ class FreeplayState extends MusicBeatSubState
trace("RANDOM SELECTED");
busy = true;
letterSort.inputEnabled = false;
var availableSongCapsules:Array<SongMenuItem> = grpCapsules.members.filter(function(cap:SongMenuItem) {
// Dead capsules are ones which were removed from the list when changing filters.
@ -969,6 +971,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...
@ -982,6 +993,7 @@ class FreeplayState extends MusicBeatSubState
function capsuleOnConfirmDefault(cap:SongMenuItem):Void
{
busy = true;
letterSort.inputEnabled = false;
PlayStatePlaylist.isStoryMode = false;

View file

@ -23,6 +23,8 @@ class LetterSort extends FlxTypedSpriteGroup<FlxSprite>
var rightArrow:FlxSprite;
var grpSeperators:Array<FlxSprite> = [];
public var inputEnabled:Bool = true;
public function new(x, y)
{
super(x, y);
@ -72,8 +74,11 @@ class LetterSort extends FlxTypedSpriteGroup<FlxSprite>
{
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)