Skip to content

Commit

Permalink
Added "per entity field" exportToToc option
Browse files Browse the repository at this point in the history
  • Loading branch information
deepnight committed Oct 11, 2023
1 parent 49851cf commit 77a4afa
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion src/ldtk/Json.hx
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ typedef AutoRuleDef = {
var outOfBoundsValue: Null<Int>;

/** Array of all the tile IDs. They are used randomly or as stamps, based on `tileMode` value. **/
@deprecation("1.4.2", "1.6.0", "tileRectsIds")
@deprecation("1.5.0", "1.5.0", "tileRectsIds")
var ?tileIds: Array<Int>;

/** Array containing all the possible tile IDs rectangles (picked randomly). **/
Expand Down Expand Up @@ -1321,6 +1321,11 @@ typedef FieldDefJson = {
@internal
@added("1.0.0")
var useForSmartColor: Bool;

/** If TRUE, the field value will be exported to the `toc` project JSON field. Only applies to Entity fields. **/
@added("1.5.0")
@internal
var exportToToc: Bool;
}


Expand Down Expand Up @@ -1614,7 +1619,28 @@ typedef CustomCommand = {
@inline
typedef TableOfContentEntry = {
var identifier: String;

@deprecation("1.5.0", "1.7.0", "instancesData")
var instances: Array<EntityReferenceInfos>;

@added("1.5.0")
var instancesData: Array<TocInstanceData>;
}


@added("1.5.0")
@inline
typedef TocInstanceData = {
/** IID information of this instance **/
var iids: EntityReferenceInfos;

var worldX : Int;
var worldY : Int;
var widPx : Int;
var heiPx : Int;

/** An object containing the values of all entity fields with the `exportToToc` option enabled. This object typing depends on actual field value types. **/
var fields: Array<Dynamic>;
}


Expand Down Expand Up @@ -1747,6 +1773,7 @@ enum TextLanguageMode {

enum ProjectFlag {
DiscardPreCsvIntGrid; // backward compatibility
ExportOldTableOfContentData;
ExportPreCsvIntGridFormat;
IgnoreBackupSuggest;
PrependIndexToLevelFileNames;
Expand Down

0 comments on commit 77a4afa

Please sign in to comment.