mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-02-17 04:11:23 -05:00
song load fix lol woops!
This commit is contained in:
parent
71ca1f8d3a
commit
b46a276671
2 changed files with 37 additions and 20 deletions
|
@ -148,20 +148,35 @@ class SongLoad
|
||||||
if (noteStuff == null)
|
if (noteStuff == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
trace(noteStuff);
|
||||||
|
|
||||||
for (sectionIndex => section in noteStuff)
|
for (sectionIndex => section in noteStuff)
|
||||||
{
|
{
|
||||||
for (noteIndex => noteDataArray in section.sectionNotes)
|
for (noteIndex => noteDataArray in section.sectionNotes)
|
||||||
{
|
{
|
||||||
|
trace(noteDataArray);
|
||||||
|
|
||||||
var arrayDipshit:Array<Dynamic> = cast noteDataArray; // crackhead
|
var arrayDipshit:Array<Dynamic> = cast noteDataArray; // crackhead
|
||||||
|
|
||||||
// at this point noteStuff[sectionIndex].sectionNotes[noteIndex] is an array because of the cast from the first line in this function
|
trace(arrayDipshit);
|
||||||
// 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
|
|
||||||
|
|
||||||
noteStuff[sectionIndex].sectionNotes[noteIndex].strumTime = arrayDipshit[0];
|
if (arrayDipshit != null)
|
||||||
noteStuff[sectionIndex].sectionNotes[noteIndex].noteData = arrayDipshit[1];
|
{
|
||||||
noteStuff[sectionIndex].sectionNotes[noteIndex].sustainLength = arrayDipshit[2];
|
// at this point noteStuff[sectionIndex].sectionNotes[noteIndex] is an array because of the cast from the first line in this function
|
||||||
noteStuff[sectionIndex].sectionNotes[noteIndex].altNote = arrayDipshit[3];
|
// 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
|
||||||
|
|
||||||
|
noteStuff[sectionIndex].sectionNotes[noteIndex].strumTime = arrayDipshit[0];
|
||||||
|
noteStuff[sectionIndex].sectionNotes[noteIndex].noteData = arrayDipshit[1];
|
||||||
|
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;
|
PlayState.isStoryMode = true;
|
||||||
selectedWeek = true;
|
selectedWeek = true;
|
||||||
|
|
||||||
var diffic = "";
|
PlayState.SONG = SongLoad.loadFromJson(PlayState.storyPlaylist[0].toLowerCase(), PlayState.storyPlaylist[0].toLowerCase());
|
||||||
|
|
||||||
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.storyWeek = curWeek;
|
PlayState.storyWeek = curWeek;
|
||||||
PlayState.campaignScore = 0;
|
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)
|
new FlxTimer().start(1, function(tmr:FlxTimer)
|
||||||
{
|
{
|
||||||
LoadingState.loadAndSwitchState(new PlayState(), true);
|
LoadingState.loadAndSwitchState(new PlayState(), true);
|
||||||
|
|
Loading…
Reference in a new issue