From aab9cab7b402d6e630a3e79d28e8e12e365329de Mon Sep 17 00:00:00 2001 From: KadeDeveloper Date: Tue, 20 Jul 2021 13:22:14 -0700 Subject: [PATCH] fix songs with spaces (part 200) --- source/Character.hx | 2 +- source/ChartingState.hx | 7 ++++++- source/PlayState.hx | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/source/Character.hx b/source/Character.hx index 489f118..2f15c00 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -260,7 +260,7 @@ class Character extends FlxSprite case 'bf-car': var tex = Paths.getSparrowAtlas('bfCar','shared',true); frames = tex; - animation.addByPrefix('idle', 'BF idle dance', 16, false); + animation.addByPrefix('idle', 'BF idle dance', 24, false); animation.addByPrefix('singUP', 'BF NOTE UP0', 24, false); animation.addByPrefix('singLEFT', 'BF NOTE LEFT0', 24, false); animation.addByPrefix('singRIGHT', 'BF NOTE RIGHT0', 24, false); diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 8c6cf56..ca5a1df 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -2549,7 +2549,12 @@ class ChartingState extends MusicBeatState function loadJson(song:String):Void { - PlayState.SONG = Song.loadFromJson(song.toLowerCase(), song.toLowerCase()); + var format = StringTools.replace(PlayState.SONG.song.toLowerCase(), " ", "-"); + switch (format) { + case 'Dad-Battle': format = 'Dadbattle'; + case 'Philly-Nice': format = 'Philly'; + } + PlayState.SONG = Song.loadFromJson(format, format); LoadingState.loadAndSwitchState(new ChartingState()); } diff --git a/source/PlayState.hx b/source/PlayState.hx index 68b5f24..8ac3f34 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -189,7 +189,7 @@ class PlayState extends MusicBeatState var notesHitArray:Array = []; var currentFrames:Int = 0; var idleToBeat:Bool = true; // change if bf and dad would idle to the beat of the song - var idleBeat:Int = 1; // how frequently bf and dad would play their idle animation(1 - every beat, 2 - every 2 beats and so on) + var idleBeat:Int = 4; // how frequently bf and dad would play their idle animation(1 - every beat, 2 - every 2 beats and so on) public var dialogue:Array = ['dad:blah blah blah', 'bf:coolswag'];