mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-12-26 15:07:14 +00:00
CLEANED JSON LOL
This commit is contained in:
parent
38bb4848a5
commit
f31813c9db
BIN
assets/data/smash/smash.json
Normal file
BIN
assets/data/smash/smash.json
Normal file
Binary file not shown.
|
@ -362,7 +362,7 @@ class ChartingState extends MusicBeatState
|
|||
"song": curSong,
|
||||
"bpm": Conductor.bpm,
|
||||
"sections": sections.length,
|
||||
'notes': getNotes
|
||||
'notes': sections
|
||||
};
|
||||
|
||||
var data:String = Json.stringify(json);
|
||||
|
|
|
@ -9,7 +9,7 @@ class Main extends Sprite
|
|||
public function new()
|
||||
{
|
||||
super();
|
||||
addChild(new FlxGame(0, 0, ChartingState));
|
||||
addChild(new FlxGame(0, 0, PlayState));
|
||||
|
||||
#if !mobile
|
||||
addChild(new FPS(10, 3, 0xFFFFFF));
|
||||
|
|
|
@ -71,7 +71,7 @@ class PlayState extends MusicBeatState
|
|||
persistentDraw = true;
|
||||
|
||||
if (SONG == null)
|
||||
SONG = Song.loadFromJson('tutorial');
|
||||
SONG = Song.loadFromJson('smash');
|
||||
|
||||
var bg:FlxSprite = new FlxSprite(-600, -200).loadGraphic(AssetPaths.stageback__png);
|
||||
// bg.setGraphicSize(Std.int(bg.width * 2.5));
|
||||
|
|
|
@ -3,6 +3,8 @@ package;
|
|||
import haxe.Json;
|
||||
import lime.utils.Assets;
|
||||
|
||||
using StringTools;
|
||||
|
||||
class Song
|
||||
{
|
||||
public var song:String;
|
||||
|
@ -32,7 +34,17 @@ class Song
|
|||
var daSong:String = '';
|
||||
var daSectionLengths:Array<Int> = [];
|
||||
|
||||
var songData = Json.parse(Assets.getText('assets/data/' + jsonInput + '/' + jsonInput + '.json'));
|
||||
var rawJson = Assets.getText('assets/data/' + jsonInput + '/' + jsonInput + '.json').trim();
|
||||
|
||||
while (!rawJson.endsWith("}"))
|
||||
{
|
||||
rawJson = rawJson.substr(0, rawJson.length - 1);
|
||||
// LOL GOING THROUGH THE BULLSHIT TO CLEAN IDK WHATS STRANGE
|
||||
}
|
||||
|
||||
trace(rawJson);
|
||||
|
||||
var songData = Json.parse(rawJson);
|
||||
|
||||
daNotes = songData.notes;
|
||||
daSong = songData.song;
|
||||
|
|
Loading…
Reference in a new issue