From 7e1dfd67d388b0901f9c917aeb198ef17dca1f5a Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Fri, 3 Dec 2021 07:29:47 -0500 Subject: [PATCH] accomodate for map stuff IN PROGREESSSS --- source/Character.hx | 2 +- source/ChartingState.hx | 7 ++++--- source/Conductor.hx | 2 +- source/FreeplayState.hx | 3 ++- source/SongLoad.hx | 16 +++++++--------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/source/Character.hx b/source/Character.hx index b2eb52899..db69aa20a 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -552,7 +552,7 @@ class Character extends FlxSprite { var swagshit = SongLoad.loadFromJson('picospeaker', 'stress'); - var notes = swagshit.notes[0]; + var notes = swagshit.extraNotes.get('picospeaker'); for (section in notes) { diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 35bc44045..7c08070c5 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -132,14 +132,15 @@ class ChartingState extends MusicBeatState { _song = { song: 'Test', - notes: [[]], + notes: [], bpm: 150, needsVoices: true, player1: 'bf', player2: 'dad', - speed: [1], + speed: [], validScore: false, - voiceList: ["BF", "BF-pixel"] + voiceList: ["BF", "BF-pixel"], + extraNotes: [] }; } diff --git a/source/Conductor.hx b/source/Conductor.hx index 973009cd2..0d85c2ad7 100644 --- a/source/Conductor.hx +++ b/source/Conductor.hx @@ -33,7 +33,7 @@ class Conductor var curBPM:Float = song.bpm; var totalSteps:Int = 0; var totalPos:Float = 0; - for (i in 0...song.notes.length) + for (i in 0...song.notes[SongLoad.curDiff].length) { if (song.notes[SongLoad.curDiff][i].changeBPM && song.notes[SongLoad.curDiff][i].bpm != curBPM) { diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 88bd39a2b..c68e509f2 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -485,7 +485,8 @@ class FreeplayState extends MusicBeatState PlayState.SONG = SongLoad.loadFromJson(poop, songs[curSelected].songName.toLowerCase()); PlayState.isStoryMode = false; PlayState.storyDifficulty = curDifficulty; - SongLoad.curDiff = curDifficulty; + // SongLoad.curDiff = Highscore.formatSong() + SongLoad.curDiff = 'normal'; PlayState.storyWeek = songs[curSelected].week; trace('CUR WEEK' + PlayState.storyWeek); diff --git a/source/SongLoad.hx b/source/SongLoad.hx index 124f18f36..ac0b0c46b 100644 --- a/source/SongLoad.hx +++ b/source/SongLoad.hx @@ -10,29 +10,24 @@ using StringTools; typedef SwagSong = { var song:String; - var notes:Array>; + var notes:Map>; var bpm:Float; var needsVoices:Bool; var voiceList:Array; - var speed:Array; + var speed:Map; var player1:String; var player2:String; var validScore:Bool; + var extraNotes:Map>; } class SongLoad { - public static var curDiff(default, set):Int; + public static var curDiff:String = 'normal'; public static var curNotes:Array; public static var songData:SwagSong; - static function set_curDiff(val:Int):Int - { - // automatically changes the selected NOTES? - return val; - } - public static function loadFromJson(jsonInput:String, ?folder:String):SwagSong { var rawJson = Assets.getText(Paths.json(folder.toLowerCase() + '/' + jsonInput.toLowerCase())).trim(); @@ -68,7 +63,10 @@ class SongLoad swagShit.validScore = true; // swagShit.notes[0] = cast Json.parse(rawJson).song.notes[SongLoad.curDiff]; // by default uses + trace(swagShit); + songData = swagShit; + // curNotes = songData.notes.get('normal'); return swagShit; }