From 5868cb1d78cdfefcabe24dd2906dc62a6ccd4b0d Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Mon, 5 Jan 2026 19:53:55 -0500 Subject: [PATCH] Update json2object to respect @:order when exporting + skip default values * @:order is only for Maps, not Arrays (IDK how this compiled before lol?) * Don't use @:default on version number. * Don't use @:default for ChartManifestData * Don't use @:default for generatedBy --- hmm.json | 2 +- source/funkin/data/song/SongData.hx | 8 +++----- source/funkin/data/song/importer/ChartManifestData.hx | 1 - 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/hmm.json b/hmm.json index 9e4ca1c01..5e23629e2 100644 --- a/hmm.json +++ b/hmm.json @@ -159,7 +159,7 @@ "name": "json2object", "type": "git", "dir": null, - "ref": "a7e4cef3d444bea8d8244d6e59ab82f5a593f597", + "ref": "59e0467c953d1f26e3cbf2a070f140e2d2e8457d", "url": "https://github.com/FunkinCrew/json2object" }, { diff --git a/source/funkin/data/song/SongData.hx b/source/funkin/data/song/SongData.hx index e973f8d1e..2d7b8c674 100644 --- a/source/funkin/data/song/SongData.hx +++ b/source/funkin/data/song/SongData.hx @@ -19,7 +19,6 @@ class SongMetadata implements ICloneable * A semantic versioning string for the song data format. * */ - // @:default(funkin.data.song.SongRegistry.SONG_METADATA_VERSION) @:jcustomparse(funkin.data.DataParse.semverVersion) @:jcustomwrite(funkin.data.DataWrite.semverVersion) public var version:Version; @@ -53,7 +52,6 @@ class SongMetadata implements ICloneable */ public var playData:SongPlayData; - @:default(funkin.data.song.SongRegistry.DEFAULT_GENERATEDBY) public var generatedBy:String; @:optional @@ -352,7 +350,6 @@ class SongMusicData implements ICloneable * A semantic versioning string for the song data format. * */ - // @:default(funkin.data.song.SongRegistry.SONG_METADATA_VERSION) @:jcustomparse(funkin.data.DataParse.semverVersion) @:jcustomwrite(funkin.data.DataWrite.semverVersion) public var version:Version; @@ -463,6 +460,7 @@ class SongPlayData implements ICloneable */ @:optional @:default(['normal' => 0]) + @:order(funkin.util.Constants.DEFAULT_DIFFICULTY_LIST_FULL) public var ratings:Map; /** @@ -595,16 +593,16 @@ class SongCharacterData implements ICloneable class SongChartData implements ICloneable { - @:default(funkin.data.song.SongRegistry.SONG_CHART_DATA_VERSION) @:jcustomparse(funkin.data.DataParse.semverVersion) @:jcustomwrite(funkin.data.DataWrite.semverVersion) public var version:Version; + @:order(funkin.util.Constants.DEFAULT_DIFFICULTY_LIST_FULL) public var scrollSpeed:Map; public var events:Array; + @:order(funkin.util.Constants.DEFAULT_DIFFICULTY_LIST_FULL) public var notes:Map>; - @:default(funkin.data.song.SongRegistry.DEFAULT_GENERATEDBY) public var generatedBy:String; /** diff --git a/source/funkin/data/song/importer/ChartManifestData.hx b/source/funkin/data/song/importer/ChartManifestData.hx index f3b97607f..407a4d4df 100644 --- a/source/funkin/data/song/importer/ChartManifestData.hx +++ b/source/funkin/data/song/importer/ChartManifestData.hx @@ -12,7 +12,6 @@ class ChartManifestData public static final invalidIdRegex:EReg = ~/[\/\\:*?"<>|]/g; - @:default(funkin.data.song.importer.ChartManifestData.CHART_MANIFEST_DATA_VERSION) @:jcustomparse(funkin.data.DataParse.semverVersion) @:jcustomwrite(funkin.data.DataWrite.semverVersion) public var version:thx.semver.Version;