From bc5cbb726f78aa3064357d9babba67fbc5ad7db1 Mon Sep 17 00:00:00 2001 From: jobeGameDev Date: Thu, 26 Sep 2024 16:19:16 +0200 Subject: [PATCH] Fix loading tileRectsIds in auto-layer rule definition (#7) When creating rules for auto-layers of an IntGrid in LDtk and saving it, then Korge-ldtk was not able to load that ldtk file any more due to differences between json file and the implemented json schema. The name of the property is different in json file from LDtk, thus @SerialName was updated. Also the type of the tileIDS field needs to be an array of array of Ints. --- .../src/commonMain/kotlin/korlibs/korge/ldtk/LDTKJson.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/korge-ldtk/src/commonMain/kotlin/korlibs/korge/ldtk/LDTKJson.kt b/korge-ldtk/src/commonMain/kotlin/korlibs/korge/ldtk/LDTKJson.kt index 1fe6028..03595a5 100644 --- a/korge-ldtk/src/commonMain/kotlin/korlibs/korge/ldtk/LDTKJson.kt +++ b/korge-ldtk/src/commonMain/kotlin/korlibs/korge/ldtk/LDTKJson.kt @@ -1072,8 +1072,8 @@ data class AutoLayerRuleDefinition ( /** * Array of all the tile IDs. They are used randomly or as stamps, based on `tileMode` value. */ - @SerialName("tileIds") - val tileIDS: IntArray, + @SerialName("tileRectsIds") + val tileIDS: List, /** * Defines how tileIds array is used Possible values: `Single`, `Stamp`