mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-11-25 08:13:45 +00:00
song load fix lol woops!
This commit is contained in:
parent
71ca1f8d3a
commit
b46a276671
|
@ -148,12 +148,20 @@ class SongLoad
|
|||
if (noteStuff == null)
|
||||
return;
|
||||
|
||||
trace(noteStuff);
|
||||
|
||||
for (sectionIndex => section in noteStuff)
|
||||
{
|
||||
for (noteIndex => noteDataArray in section.sectionNotes)
|
||||
{
|
||||
trace(noteDataArray);
|
||||
|
||||
var arrayDipshit:Array<Dynamic> = cast noteDataArray; // crackhead
|
||||
|
||||
trace(arrayDipshit);
|
||||
|
||||
if (arrayDipshit != null)
|
||||
{
|
||||
// at this point noteStuff[sectionIndex].sectionNotes[noteIndex] is an array because of the cast from the first line in this function
|
||||
// so this line right here turns it back into the NoteData typedef type because of another bastard cast
|
||||
noteStuff[sectionIndex].sectionNotes[noteIndex] = cast SongLoad.getDefaultNoteData(); // turn it from an array (because of the cast), back to noteData? yeah that works
|
||||
|
@ -163,6 +171,13 @@ class SongLoad
|
|||
noteStuff[sectionIndex].sectionNotes[noteIndex].sustainLength = arrayDipshit[2];
|
||||
noteStuff[sectionIndex].sectionNotes[noteIndex].altNote = arrayDipshit[3];
|
||||
}
|
||||
else if (noteDataArray != null)
|
||||
{
|
||||
noteStuff[sectionIndex].sectionNotes[noteIndex] = cast noteDataArray;
|
||||
}
|
||||
else
|
||||
throw "shit brokey"; // i actually dont know how throw works lol
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -310,21 +310,23 @@ class StoryMenuState extends MusicBeatState
|
|||
PlayState.isStoryMode = true;
|
||||
selectedWeek = true;
|
||||
|
||||
var diffic = "";
|
||||
|
||||
switch (curDifficulty)
|
||||
{
|
||||
case 0:
|
||||
diffic = '-easy';
|
||||
case 2:
|
||||
diffic = '-hard';
|
||||
}
|
||||
|
||||
PlayState.storyDifficulty = curDifficulty;
|
||||
|
||||
PlayState.SONG = SongLoad.loadFromJson(PlayState.storyPlaylist[0].toLowerCase() + diffic, PlayState.storyPlaylist[0].toLowerCase());
|
||||
PlayState.SONG = SongLoad.loadFromJson(PlayState.storyPlaylist[0].toLowerCase(), PlayState.storyPlaylist[0].toLowerCase());
|
||||
PlayState.storyWeek = curWeek;
|
||||
PlayState.campaignScore = 0;
|
||||
|
||||
PlayState.storyDifficulty = curDifficulty;
|
||||
SongLoad.curDiff = switch (curDifficulty)
|
||||
{
|
||||
case 0:
|
||||
'easy';
|
||||
case 1:
|
||||
'normal';
|
||||
case 2:
|
||||
'hard';
|
||||
default:
|
||||
'normal';
|
||||
};
|
||||
|
||||
new FlxTimer().start(1, function(tmr:FlxTimer)
|
||||
{
|
||||
LoadingState.loadAndSwitchState(new PlayState(), true);
|
||||
|
|
Loading…
Reference in a new issue