ysy no more broken song json shit
This commit is contained in:
parent
0ac8487c30
commit
4b4a90185c
|
@ -4,6 +4,7 @@ import Section.SwagSection;
|
|||
import haxe.Json;
|
||||
import haxe.format.JsonParser;
|
||||
import lime.utils.Assets;
|
||||
import sys.FileSystem;
|
||||
|
||||
using StringTools;
|
||||
|
||||
|
@ -40,8 +41,15 @@ class Song
|
|||
|
||||
public static function loadFromJson(jsonInput:String, ?folder:String):SwagSong
|
||||
{
|
||||
var rawJson = Assets.getText(Paths.json(folder.toLowerCase() + '/' + jsonInput.toLowerCase())).trim();
|
||||
|
||||
var rawJson:String;
|
||||
if (FileSystem.exists(Paths.json(folder.toLowerCase() + '/' + jsonInput.toLowerCase())))
|
||||
{
|
||||
rawJson = Assets.getText(Paths.json(folder.toLowerCase() + '/' + jsonInput.toLowerCase())).trim();
|
||||
}
|
||||
else
|
||||
{
|
||||
rawJson = '{"song": {"song": "' + jsonInput + '","bpm": 100.0,"needsVoices": true,"player1": "bf","player2": "dad","speed": 1.3,"notes": [{"lengthInSteps": 16,"mustHitSection": false,"sectionNotes": []},{"lengthInSteps": 16,"mustHitSection": false,"sectionNotes": []},{"lengthInSteps": 16,"mustHitSection": false,"sectionNotes": []},{"lengthInSteps": 16,"mustHitSection": false,"sectionNotes": []},{"lengthInSteps": 16,"mustHitSection": false,"sectionNotes": []},{"lengthInSteps": 16,"mustHitSection": false,"sectionNotes": []},{"lengthInSteps": 16,"mustHitSection": false,"sectionNotes": []},{"lengthInSteps": 16,"mustHitSection": false,"sectionNotes": []},{"lengthInSteps": 16,"mustHitSection": false,"sectionNotes": []}]},"generatedBy": "SNIFF ver.6"}';
|
||||
}
|
||||
while (!rawJson.endsWith("}"))
|
||||
{
|
||||
rawJson = rawJson.substr(0, rawJson.length - 1);
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
#automatically generated do not edit
|
||||
#@date Fri Jun 02 2023 19:16:38 GMT-0700 (Pacific Daylight Time)
|
||||
#@date Fri Jun 02 2023 19:52:08 GMT-0700 (Pacific Daylight Time)
|
||||
-cp c:\users\bamst\appdata\local\temp\2def77e625d453c59a42a972450a0ad156c9aa14
|
Loading…
Reference in New Issue