diff --git a/docs/quicktype/LdtkJson.cpp b/docs/quicktype/LdtkJson.cpp index 6dcd3c36f..792071e18 100644 --- a/docs/quicktype/LdtkJson.cpp +++ b/docs/quicktype/LdtkJson.cpp @@ -165,6 +165,7 @@ namespace quicktype { boost::optional doc; bool editor_always_show; bool editor_cut_long_values; + boost::optional editor_display_color; EditorDisplayMode editor_display_mode; EditorDisplayPos editor_display_pos; double editor_display_scale; @@ -267,6 +268,9 @@ namespace quicktype { bool & get_mutable_editor_cut_long_values() { return editor_cut_long_values; } void set_editor_cut_long_values(const bool & value) { this->editor_cut_long_values = value; } + boost::optional get_editor_display_color() const { return editor_display_color; } + void set_editor_display_color(boost::optional value) { this->editor_display_color = value; } + /** * Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `LevelTile`, * `Points`, `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`, @@ -2726,6 +2730,8 @@ namespace quicktype { boost::optional backup_rel_path; std::string bg_color; std::vector custom_commands; + int64_t default_entity_height; + int64_t default_entity_width; int64_t default_grid_size; std::string default_level_bg_color; boost::optional default_level_height; @@ -2810,6 +2816,20 @@ namespace quicktype { std::vector & get_mutable_custom_commands() { return custom_commands; } void set_custom_commands(const std::vector & value) { this->custom_commands = value; } + /** + * Default height for new entities + */ + const int64_t & get_default_entity_height() const { return default_entity_height; } + int64_t & get_mutable_default_entity_height() { return default_entity_height; } + void set_default_entity_height(const int64_t & value) { this->default_entity_height = value; } + + /** + * Default width for new entities + */ + const int64_t & get_default_entity_width() const { return default_entity_width; } + int64_t & get_mutable_default_entity_width() { return default_entity_width; } + void set_default_entity_width(const int64_t & value) { this->default_entity_width = value; } + /** * Default grid size for new layers */ @@ -3208,6 +3228,7 @@ namespace quicktype { x.set_doc(get_stack_optional(j, "doc")); x.set_editor_always_show(j.at("editorAlwaysShow").get()); x.set_editor_cut_long_values(j.at("editorCutLongValues").get()); + x.set_editor_display_color(get_stack_optional(j, "editorDisplayColor")); x.set_editor_display_mode(j.at("editorDisplayMode").get()); x.set_editor_display_pos(j.at("editorDisplayPos").get()); x.set_editor_display_scale(j.at("editorDisplayScale").get()); @@ -3244,6 +3265,7 @@ namespace quicktype { j["doc"] = x.get_doc(); j["editorAlwaysShow"] = x.get_editor_always_show(); j["editorCutLongValues"] = x.get_editor_cut_long_values(); + j["editorDisplayColor"] = x.get_editor_display_color(); j["editorDisplayMode"] = x.get_editor_display_mode(); j["editorDisplayPos"] = x.get_editor_display_pos(); j["editorDisplayScale"] = x.get_editor_display_scale(); @@ -3975,6 +3997,8 @@ namespace quicktype { x.set_backup_rel_path(get_stack_optional(j, "backupRelPath")); x.set_bg_color(j.at("bgColor").get()); x.set_custom_commands(j.at("customCommands").get>()); + x.set_default_entity_height(j.at("defaultEntityHeight").get()); + x.set_default_entity_width(j.at("defaultEntityWidth").get()); x.set_default_grid_size(j.at("defaultGridSize").get()); x.set_default_level_bg_color(j.at("defaultLevelBgColor").get()); x.set_default_level_height(get_stack_optional(j, "defaultLevelHeight")); @@ -4015,6 +4039,8 @@ namespace quicktype { j["backupRelPath"] = x.get_backup_rel_path(); j["bgColor"] = x.get_bg_color(); j["customCommands"] = x.get_custom_commands(); + j["defaultEntityHeight"] = x.get_default_entity_height(); + j["defaultEntityWidth"] = x.get_default_entity_width(); j["defaultGridSize"] = x.get_default_grid_size(); j["defaultLevelBgColor"] = x.get_default_level_bg_color(); j["defaultLevelHeight"] = x.get_default_level_height(); diff --git a/docs/quicktype/LdtkJson.cs b/docs/quicktype/LdtkJson.cs index 24e62a7b5..16f008744 100644 --- a/docs/quicktype/LdtkJson.cs +++ b/docs/quicktype/LdtkJson.cs @@ -72,6 +72,18 @@ public partial class LdtkJson [JsonProperty("customCommands")] public LdtkCustomCommand[] CustomCommands { get; set; } + /// + /// Default height for new entities + /// + [JsonProperty("defaultEntityHeight")] + public long DefaultEntityHeight { get; set; } + + /// + /// Default width for new entities + /// + [JsonProperty("defaultEntityWidth")] + public long DefaultEntityWidth { get; set; } + /// /// Default grid size for new layers /// @@ -612,6 +624,9 @@ public partial class FieldDefinition [JsonProperty("editorCutLongValues")] public bool EditorCutLongValues { get; set; } + [JsonProperty("editorDisplayColor")] + public string EditorDisplayColor { get; set; } + /// /// Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `LevelTile`, /// `Points`, `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`, diff --git a/docs/quicktype/LdtkJson.go b/docs/quicktype/LdtkJson.go index 4f18fa2e9..41b54a6c9 100644 --- a/docs/quicktype/LdtkJson.go +++ b/docs/quicktype/LdtkJson.go @@ -44,6 +44,10 @@ type LdtkJSON struct { BgColor string `json:"bgColor"` // An array of command lines that can be ran manually by the user CustomCommands []LdtkCustomCommand `json:"customCommands"` + // Default height for new entities + DefaultEntityHeight int64 `json:"defaultEntityHeight"` + // Default width for new entities + DefaultEntityWidth int64 `json:"defaultEntityWidth"` // Default grid size for new layers DefaultGridSize int64 `json:"defaultGridSize"` // Default background color of levels @@ -270,6 +274,7 @@ type FieldDefinition struct { Doc *string `json:"doc"` EditorAlwaysShow bool `json:"editorAlwaysShow"` EditorCutLongValues bool `json:"editorCutLongValues"` + EditorDisplayColor *string `json:"editorDisplayColor"` // Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `LevelTile`, // `Points`, `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`, // `ArrayCountWithLabel`, `ArrayCountNoLabel`, `RefLinkBetweenPivots`, diff --git a/docs/quicktype/LdtkJson.js b/docs/quicktype/LdtkJson.js index 623582619..42bc73eb9 100644 --- a/docs/quicktype/LdtkJson.js +++ b/docs/quicktype/LdtkJson.js @@ -178,6 +178,8 @@ const typeMap = { { json: "backupRelPath", js: "backupRelPath", typ: u(undefined, u(null, "")) }, { json: "bgColor", js: "bgColor", typ: "" }, { json: "customCommands", js: "customCommands", typ: a(r("LdtkCustomCommand")) }, + { json: "defaultEntityHeight", js: "defaultEntityHeight", typ: 0 }, + { json: "defaultEntityWidth", js: "defaultEntityWidth", typ: 0 }, { json: "defaultGridSize", js: "defaultGridSize", typ: 0 }, { json: "defaultLevelBgColor", js: "defaultLevelBgColor", typ: "" }, { json: "defaultLevelHeight", js: "defaultLevelHeight", typ: u(undefined, u(0, null)) }, @@ -337,6 +339,7 @@ const typeMap = { { json: "doc", js: "doc", typ: u(undefined, u(null, "")) }, { json: "editorAlwaysShow", js: "editorAlwaysShow", typ: true }, { json: "editorCutLongValues", js: "editorCutLongValues", typ: true }, + { json: "editorDisplayColor", js: "editorDisplayColor", typ: u(undefined, u(null, "")) }, { json: "editorDisplayMode", js: "editorDisplayMode", typ: r("EditorDisplayMode") }, { json: "editorDisplayPos", js: "editorDisplayPos", typ: r("EditorDisplayPos") }, { json: "editorDisplayScale", js: "editorDisplayScale", typ: 3.14 }, diff --git a/docs/quicktype/LdtkJson.py b/docs/quicktype/LdtkJson.py index 80815a01d..c87ee5cdf 100644 --- a/docs/quicktype/LdtkJson.py +++ b/docs/quicktype/LdtkJson.py @@ -193,6 +193,7 @@ class FieldDefinition: doc: Optional[str] editor_always_show: bool editor_cut_long_values: bool + editor_display_color: Optional[str] """Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `LevelTile`, `Points`, `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`, `ArrayCountWithLabel`, `ArrayCountNoLabel`, `RefLinkBetweenPivots`, @@ -238,7 +239,7 @@ class FieldDefinition: """ use_for_smart_color: bool - def __init__(self, type: str, accept_file_types: Optional[List[str]], allowed_refs: AllowedRefs, allowed_refs_entity_uid: Optional[int], allowed_ref_tags: List[str], allow_out_of_level_ref: bool, array_max_length: Optional[int], array_min_length: Optional[int], auto_chain_ref: bool, can_be_null: bool, default_override: Any, doc: Optional[str], editor_always_show: bool, editor_cut_long_values: bool, editor_display_mode: EditorDisplayMode, editor_display_pos: EditorDisplayPos, editor_display_scale: float, editor_link_style: EditorLinkStyle, editor_show_in_world: bool, editor_text_prefix: Optional[str], editor_text_suffix: Optional[str], identifier: str, is_array: bool, max: Optional[float], min: Optional[float], regex: Optional[str], symmetrical_ref: bool, text_language_mode: Optional[TextLanguageMode], tileset_uid: Optional[int], field_definition_type: str, uid: int, use_for_smart_color: bool) -> None: + def __init__(self, type: str, accept_file_types: Optional[List[str]], allowed_refs: AllowedRefs, allowed_refs_entity_uid: Optional[int], allowed_ref_tags: List[str], allow_out_of_level_ref: bool, array_max_length: Optional[int], array_min_length: Optional[int], auto_chain_ref: bool, can_be_null: bool, default_override: Any, doc: Optional[str], editor_always_show: bool, editor_cut_long_values: bool, editor_display_color: Optional[str], editor_display_mode: EditorDisplayMode, editor_display_pos: EditorDisplayPos, editor_display_scale: float, editor_link_style: EditorLinkStyle, editor_show_in_world: bool, editor_text_prefix: Optional[str], editor_text_suffix: Optional[str], identifier: str, is_array: bool, max: Optional[float], min: Optional[float], regex: Optional[str], symmetrical_ref: bool, text_language_mode: Optional[TextLanguageMode], tileset_uid: Optional[int], field_definition_type: str, uid: int, use_for_smart_color: bool) -> None: self.type = type self.accept_file_types = accept_file_types self.allowed_refs = allowed_refs @@ -253,6 +254,7 @@ def __init__(self, type: str, accept_file_types: Optional[List[str]], allowed_re self.doc = doc self.editor_always_show = editor_always_show self.editor_cut_long_values = editor_cut_long_values + self.editor_display_color = editor_display_color self.editor_display_mode = editor_display_mode self.editor_display_pos = editor_display_pos self.editor_display_scale = editor_display_scale @@ -289,6 +291,7 @@ def from_dict(obj: Any) -> 'FieldDefinition': doc = from_union([from_none, from_str], obj.get("doc")) editor_always_show = from_bool(obj.get("editorAlwaysShow")) editor_cut_long_values = from_bool(obj.get("editorCutLongValues")) + editor_display_color = from_union([from_none, from_str], obj.get("editorDisplayColor")) editor_display_mode = EditorDisplayMode(obj.get("editorDisplayMode")) editor_display_pos = EditorDisplayPos(obj.get("editorDisplayPos")) editor_display_scale = from_float(obj.get("editorDisplayScale")) @@ -307,7 +310,7 @@ def from_dict(obj: Any) -> 'FieldDefinition': field_definition_type = from_str(obj.get("type")) uid = from_int(obj.get("uid")) use_for_smart_color = from_bool(obj.get("useForSmartColor")) - return FieldDefinition(type, accept_file_types, allowed_refs, allowed_refs_entity_uid, allowed_ref_tags, allow_out_of_level_ref, array_max_length, array_min_length, auto_chain_ref, can_be_null, default_override, doc, editor_always_show, editor_cut_long_values, editor_display_mode, editor_display_pos, editor_display_scale, editor_link_style, editor_show_in_world, editor_text_prefix, editor_text_suffix, identifier, is_array, max, min, regex, symmetrical_ref, text_language_mode, tileset_uid, field_definition_type, uid, use_for_smart_color) + return FieldDefinition(type, accept_file_types, allowed_refs, allowed_refs_entity_uid, allowed_ref_tags, allow_out_of_level_ref, array_max_length, array_min_length, auto_chain_ref, can_be_null, default_override, doc, editor_always_show, editor_cut_long_values, editor_display_color, editor_display_mode, editor_display_pos, editor_display_scale, editor_link_style, editor_show_in_world, editor_text_prefix, editor_text_suffix, identifier, is_array, max, min, regex, symmetrical_ref, text_language_mode, tileset_uid, field_definition_type, uid, use_for_smart_color) def to_dict(self) -> dict: result: dict = {} @@ -331,6 +334,8 @@ def to_dict(self) -> dict: result["doc"] = from_union([from_none, from_str], self.doc) result["editorAlwaysShow"] = from_bool(self.editor_always_show) result["editorCutLongValues"] = from_bool(self.editor_cut_long_values) + if self.editor_display_color is not None: + result["editorDisplayColor"] = from_union([from_none, from_str], self.editor_display_color) result["editorDisplayMode"] = to_enum(EditorDisplayMode, self.editor_display_mode) result["editorDisplayPos"] = to_enum(EditorDisplayPos, self.editor_display_pos) result["editorDisplayScale"] = to_float(self.editor_display_scale) @@ -2372,6 +2377,10 @@ class LdtkJSON: bg_color: str """An array of command lines that can be ran manually by the user""" custom_commands: List[LdtkCustomCommand] + """Default height for new entities""" + default_entity_height: int + """Default width for new entities""" + default_entity_width: int """Default grid size for new layers""" default_grid_size: int """Default background color of levels""" @@ -2481,7 +2490,7 @@ class LdtkJSON: """ worlds: List[World] - def __init__(self, forced_refs: Optional[ForcedRefs], app_build_id: float, backup_limit: int, backup_on_save: bool, backup_rel_path: Optional[str], bg_color: str, custom_commands: List[LdtkCustomCommand], default_grid_size: int, default_level_bg_color: str, default_level_height: Optional[int], default_level_width: Optional[int], default_pivot_x: float, default_pivot_y: float, defs: Definitions, dummy_world_iid: str, export_level_bg: bool, export_png: Optional[bool], export_tiled: bool, external_levels: bool, flags: List[Flag], identifier_style: IdentifierStyle, iid: str, image_export_mode: ImageExportMode, json_version: str, level_name_pattern: str, levels: List[Level], minify_json: bool, next_uid: int, png_file_pattern: Optional[str], simplified_export: bool, toc: List[LdtkTableOfContentEntry], tutorial_desc: Optional[str], world_grid_height: Optional[int], world_grid_width: Optional[int], world_layout: Optional[WorldLayout], worlds: List[World]) -> None: + def __init__(self, forced_refs: Optional[ForcedRefs], app_build_id: float, backup_limit: int, backup_on_save: bool, backup_rel_path: Optional[str], bg_color: str, custom_commands: List[LdtkCustomCommand], default_entity_height: int, default_entity_width: int, default_grid_size: int, default_level_bg_color: str, default_level_height: Optional[int], default_level_width: Optional[int], default_pivot_x: float, default_pivot_y: float, defs: Definitions, dummy_world_iid: str, export_level_bg: bool, export_png: Optional[bool], export_tiled: bool, external_levels: bool, flags: List[Flag], identifier_style: IdentifierStyle, iid: str, image_export_mode: ImageExportMode, json_version: str, level_name_pattern: str, levels: List[Level], minify_json: bool, next_uid: int, png_file_pattern: Optional[str], simplified_export: bool, toc: List[LdtkTableOfContentEntry], tutorial_desc: Optional[str], world_grid_height: Optional[int], world_grid_width: Optional[int], world_layout: Optional[WorldLayout], worlds: List[World]) -> None: self.forced_refs = forced_refs self.app_build_id = app_build_id self.backup_limit = backup_limit @@ -2489,6 +2498,8 @@ def __init__(self, forced_refs: Optional[ForcedRefs], app_build_id: float, backu self.backup_rel_path = backup_rel_path self.bg_color = bg_color self.custom_commands = custom_commands + self.default_entity_height = default_entity_height + self.default_entity_width = default_entity_width self.default_grid_size = default_grid_size self.default_level_bg_color = default_level_bg_color self.default_level_height = default_level_height @@ -2529,6 +2540,8 @@ def from_dict(obj: Any) -> 'LdtkJSON': backup_rel_path = from_union([from_none, from_str], obj.get("backupRelPath")) bg_color = from_str(obj.get("bgColor")) custom_commands = from_list(LdtkCustomCommand.from_dict, obj.get("customCommands")) + default_entity_height = from_int(obj.get("defaultEntityHeight")) + default_entity_width = from_int(obj.get("defaultEntityWidth")) default_grid_size = from_int(obj.get("defaultGridSize")) default_level_bg_color = from_str(obj.get("defaultLevelBgColor")) default_level_height = from_union([from_none, from_int], obj.get("defaultLevelHeight")) @@ -2558,7 +2571,7 @@ def from_dict(obj: Any) -> 'LdtkJSON': world_grid_width = from_union([from_none, from_int], obj.get("worldGridWidth")) world_layout = from_union([from_none, WorldLayout], obj.get("worldLayout")) worlds = from_list(World.from_dict, obj.get("worlds")) - return LdtkJSON(forced_refs, app_build_id, backup_limit, backup_on_save, backup_rel_path, bg_color, custom_commands, default_grid_size, default_level_bg_color, default_level_height, default_level_width, default_pivot_x, default_pivot_y, defs, dummy_world_iid, export_level_bg, export_png, export_tiled, external_levels, flags, identifier_style, iid, image_export_mode, json_version, level_name_pattern, levels, minify_json, next_uid, png_file_pattern, simplified_export, toc, tutorial_desc, world_grid_height, world_grid_width, world_layout, worlds) + return LdtkJSON(forced_refs, app_build_id, backup_limit, backup_on_save, backup_rel_path, bg_color, custom_commands, default_entity_height, default_entity_width, default_grid_size, default_level_bg_color, default_level_height, default_level_width, default_pivot_x, default_pivot_y, defs, dummy_world_iid, export_level_bg, export_png, export_tiled, external_levels, flags, identifier_style, iid, image_export_mode, json_version, level_name_pattern, levels, minify_json, next_uid, png_file_pattern, simplified_export, toc, tutorial_desc, world_grid_height, world_grid_width, world_layout, worlds) def to_dict(self) -> dict: result: dict = {} @@ -2571,6 +2584,8 @@ def to_dict(self) -> dict: result["backupRelPath"] = from_union([from_none, from_str], self.backup_rel_path) result["bgColor"] = from_str(self.bg_color) result["customCommands"] = from_list(lambda x: to_class(LdtkCustomCommand, x), self.custom_commands) + result["defaultEntityHeight"] = from_int(self.default_entity_height) + result["defaultEntityWidth"] = from_int(self.default_entity_width) result["defaultGridSize"] = from_int(self.default_grid_size) result["defaultLevelBgColor"] = from_str(self.default_level_bg_color) if self.default_level_height is not None: diff --git a/docs/quicktype/LdtkJson.rs b/docs/quicktype/LdtkJson.rs index 7ccc57550..ce8d29f61 100644 --- a/docs/quicktype/LdtkJson.rs +++ b/docs/quicktype/LdtkJson.rs @@ -20,6 +20,7 @@ use std::collections::HashMap; /// array of levels, - a group of definitions (that can probably be safely ignored for most /// users). #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct LdtkJson { /// This object is not actually used by LDtk. It ONLY exists to force explicit references to /// all types, to make sure QuickType finds them and integrate all of them. Otherwise, @@ -32,156 +33,129 @@ pub struct LdtkJson { /// Note that the build identifier is just the date of the release, so it's not unique to /// each user (one single global ID per LDtk public release), and as a result, completely /// anonymous. - #[serde(rename = "appBuildId")] app_build_id: f64, /// Number of backup files to keep, if the `backupOnSave` is TRUE - #[serde(rename = "backupLimit")] backup_limit: i64, /// If TRUE, an extra copy of the project will be created in a sub folder, when saving. - #[serde(rename = "backupOnSave")] backup_on_save: bool, /// Target relative path to store backup files - #[serde(rename = "backupRelPath")] backup_rel_path: Option, /// Project background color - #[serde(rename = "bgColor")] bg_color: String, /// An array of command lines that can be ran manually by the user - #[serde(rename = "customCommands")] custom_commands: Vec, + /// Default height for new entities + default_entity_height: i64, + + /// Default width for new entities + default_entity_width: i64, + /// Default grid size for new layers - #[serde(rename = "defaultGridSize")] default_grid_size: i64, /// Default background color of levels - #[serde(rename = "defaultLevelBgColor")] default_level_bg_color: String, /// **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. /// It will then be `null`. You can enable the Multi-worlds advanced project option to enable /// the change immediately.

Default new level height - #[serde(rename = "defaultLevelHeight")] default_level_height: Option, /// **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. /// It will then be `null`. You can enable the Multi-worlds advanced project option to enable /// the change immediately.

Default new level width - #[serde(rename = "defaultLevelWidth")] default_level_width: Option, /// Default X pivot (0 to 1) for new entities - #[serde(rename = "defaultPivotX")] default_pivot_x: f64, /// Default Y pivot (0 to 1) for new entities - #[serde(rename = "defaultPivotY")] default_pivot_y: f64, /// A structure containing all the definitions of this project - #[serde(rename = "defs")] defs: Definitions, /// If the project isn't in MultiWorlds mode, this is the IID of the internal "dummy" World. - #[serde(rename = "dummyWorldIid")] dummy_world_iid: String, /// If TRUE, the exported PNGs will include the level background (color or image). - #[serde(rename = "exportLevelBg")] export_level_bg: bool, /// **WARNING**: this deprecated value is no longer exported since version 0.9.3 Replaced /// by: `imageExportMode` - #[serde(rename = "exportPng")] export_png: Option, /// If TRUE, a Tiled compatible file will also be generated along with the LDtk JSON file /// (default is FALSE) - #[serde(rename = "exportTiled")] export_tiled: bool, /// If TRUE, one file will be saved for the project (incl. all its definitions) and one file /// in a sub-folder for each level. - #[serde(rename = "externalLevels")] external_levels: bool, /// An array containing various advanced flags (ie. options or other states). Possible /// values: `DiscardPreCsvIntGrid`, `ExportPreCsvIntGridFormat`, `IgnoreBackupSuggest`, /// `PrependIndexToLevelFileNames`, `MultiWorlds`, `UseMultilinesType` - #[serde(rename = "flags")] flags: Vec, /// Naming convention for Identifiers (first-letter uppercase, full uppercase etc.) Possible /// values: `Capitalize`, `Uppercase`, `Lowercase`, `Free` - #[serde(rename = "identifierStyle")] identifier_style: IdentifierStyle, /// Unique project identifier - #[serde(rename = "iid")] iid: String, /// "Image export" option when saving project. Possible values: `None`, `OneImagePerLayer`, /// `OneImagePerLevel`, `LayersAndLevels` - #[serde(rename = "imageExportMode")] image_export_mode: ImageExportMode, /// File format version - #[serde(rename = "jsonVersion")] json_version: String, /// The default naming convention for level identifiers. - #[serde(rename = "levelNamePattern")] level_name_pattern: String, /// All levels. The order of this array is only relevant in `LinearHorizontal` and /// `linearVertical` world layouts (see `worldLayout` value).
Otherwise, you should /// refer to the `worldX`,`worldY` coordinates of each Level. - #[serde(rename = "levels")] levels: Vec, /// If TRUE, the Json is partially minified (no indentation, nor line breaks, default is /// FALSE) - #[serde(rename = "minifyJson")] minify_json: bool, /// Next Unique integer ID available - #[serde(rename = "nextUid")] next_uid: i64, /// File naming pattern for exported PNGs - #[serde(rename = "pngFilePattern")] png_file_pattern: Option, /// If TRUE, a very simplified will be generated on saving, for quicker & easier engine /// integration. - #[serde(rename = "simplifiedExport")] simplified_export: bool, /// All instances of entities that have their `exportToToc` flag enabled are listed in this /// array. - #[serde(rename = "toc")] toc: Vec, /// This optional description is used by LDtk Samples to show up some informations and /// instructions. - #[serde(rename = "tutorialDesc")] tutorial_desc: Option, /// **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. /// It will then be `null`. You can enable the Multi-worlds advanced project option to enable /// the change immediately.

Height of the world grid in pixels. - #[serde(rename = "worldGridHeight")] world_grid_height: Option, /// **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. /// It will then be `null`. You can enable the Multi-worlds advanced project option to enable /// the change immediately.

Width of the world grid in pixels. - #[serde(rename = "worldGridWidth")] world_grid_width: Option, /// **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. @@ -189,7 +163,6 @@ pub struct LdtkJson { /// the change immediately.

An enum that describes how levels are organized in /// this project (ie. linearly or in a 2D space). Possible values: <`null`>, `Free`, /// `GridVania`, `LinearHorizontal`, `LinearVertical` - #[serde(rename = "worldLayout")] world_layout: Option, /// This array will be empty, unless you enable the Multi-Worlds in the project advanced @@ -201,20 +174,32 @@ pub struct LdtkJson { /// layout related values (eg. `worldGridWidth` etc).

If you want to start /// supporting this future update easily, please refer to this documentation: /// https://github.com/deepnight/ldtk/issues/231 - #[serde(rename = "worlds")] worlds: Vec, } #[derive(Serialize, Deserialize)] pub struct LdtkCustomCommand { - #[serde(rename = "command")] command: String, /// Possible values: `Manual`, `AfterLoad`, `BeforeSave`, `AfterSave` - #[serde(rename = "when")] when: When, } +/// Possible values: `Manual`, `AfterLoad`, `BeforeSave`, `AfterSave` +#[derive(Serialize, Deserialize)] +pub enum When { + #[serde(rename = "AfterLoad")] + AfterLoad, + + #[serde(rename = "AfterSave")] + AfterSave, + + #[serde(rename = "BeforeSave")] + BeforeSave, + + Manual, +} + /// If you're writing your own LDtk importer, you should probably just ignore *most* stuff in /// the `defs` section, as it contains data that are mostly important to the editor. To keep /// you away from the `defs` section and avoid some unnecessary JSON parsing, important data @@ -224,171 +209,136 @@ pub struct LdtkCustomCommand { /// /// A structure containing all the definitions of this project #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct Definitions { /// All entities definitions, including their custom fields - #[serde(rename = "entities")] entities: Vec, /// All internal enums - #[serde(rename = "enums")] enums: Vec, /// Note: external enums are exactly the same as `enums`, except they have a `relPath` to /// point to an external source file. - #[serde(rename = "externalEnums")] external_enums: Vec, /// All layer definitions - #[serde(rename = "layers")] layers: Vec, /// All custom fields available to all levels. - #[serde(rename = "levelFields")] level_fields: Vec, /// All tilesets - #[serde(rename = "tilesets")] tilesets: Vec, } #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct EntityDefinition { /// Base entity color - #[serde(rename = "color")] color: String, /// User defined documentation for this element to provide help/tips to level designers. - #[serde(rename = "doc")] doc: Option, /// If enabled, all instances of this entity will be listed in the project "Table of content" /// object. - #[serde(rename = "exportToToc")] export_to_toc: bool, /// Array of field definitions - #[serde(rename = "fieldDefs")] field_defs: Vec, - #[serde(rename = "fillOpacity")] fill_opacity: f64, /// Pixel height - #[serde(rename = "height")] height: i64, - #[serde(rename = "hollow")] hollow: bool, /// User defined unique identifier - #[serde(rename = "identifier")] identifier: String, /// Only applies to entities resizable on both X/Y. If TRUE, the entity instance width/height /// will keep the same aspect ratio as the definition. - #[serde(rename = "keepAspectRatio")] keep_aspect_ratio: bool, /// Possible values: `DiscardOldOnes`, `PreventAdding`, `MoveLastOne` - #[serde(rename = "limitBehavior")] limit_behavior: LimitBehavior, /// If TRUE, the maxCount is a "per world" limit, if FALSE, it's a "per level". Possible /// values: `PerLayer`, `PerLevel`, `PerWorld` - #[serde(rename = "limitScope")] limit_scope: LimitScope, - #[serde(rename = "lineOpacity")] line_opacity: f64, /// Max instances count - #[serde(rename = "maxCount")] max_count: i64, /// Max pixel height (only applies if the entity is resizable on Y) - #[serde(rename = "maxHeight")] max_height: Option, /// Max pixel width (only applies if the entity is resizable on X) - #[serde(rename = "maxWidth")] max_width: Option, /// Min pixel height (only applies if the entity is resizable on Y) - #[serde(rename = "minHeight")] min_height: Option, /// Min pixel width (only applies if the entity is resizable on X) - #[serde(rename = "minWidth")] min_width: Option, /// An array of 4 dimensions for the up/right/down/left borders (in this order) when using /// 9-slice mode for `tileRenderMode`.
If the tileRenderMode is not NineSlice, then /// this array is empty.
See: https://en.wikipedia.org/wiki/9-slice_scaling - #[serde(rename = "nineSliceBorders")] nine_slice_borders: Vec, /// Pivot X coordinate (from 0 to 1.0) - #[serde(rename = "pivotX")] pivot_x: f64, /// Pivot Y coordinate (from 0 to 1.0) - #[serde(rename = "pivotY")] pivot_y: f64, /// Possible values: `Rectangle`, `Ellipse`, `Tile`, `Cross` - #[serde(rename = "renderMode")] render_mode: RenderMode, /// If TRUE, the entity instances will be resizable horizontally - #[serde(rename = "resizableX")] resizable_x: bool, /// If TRUE, the entity instances will be resizable vertically - #[serde(rename = "resizableY")] resizable_y: bool, /// Display entity name in editor - #[serde(rename = "showName")] show_name: bool, /// An array of strings that classifies this entity - #[serde(rename = "tags")] tags: Vec, /// **WARNING**: this deprecated value is no longer exported since version 1.2.0 Replaced /// by: `tileRect` - #[serde(rename = "tileId")] tile_id: Option, - #[serde(rename = "tileOpacity")] tile_opacity: f64, /// An object representing a rectangle from an existing Tileset - #[serde(rename = "tileRect")] tile_rect: Option, /// An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible /// values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, /// `FullSizeUncropped`, `NineSlice` - #[serde(rename = "tileRenderMode")] tile_render_mode: TileRenderMode, /// Tileset ID used for optional tile display - #[serde(rename = "tilesetId")] tileset_id: Option, /// Unique Int identifier - #[serde(rename = "uid")] uid: i64, /// Pixel width - #[serde(rename = "width")] width: i64, } /// This section is mostly only intended for the LDtk editor app itself. You can safely /// ignore it. #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct FieldDefinition { /// Human readable value type. Possible values: `Int, Float, String, Bool, Color, /// ExternEnum.XXX, LocalEnum.XXX, Point, FilePath`.
If the field is an array, this @@ -400,111 +350,85 @@ pub struct FieldDefinition { /// Optional list of accepted file extensions for FilePath value type. Includes the dot: /// `.ext` - #[serde(rename = "acceptFileTypes")] accept_file_types: Option>, /// Possible values: `Any`, `OnlySame`, `OnlyTags`, `OnlySpecificEntity` - #[serde(rename = "allowedRefs")] allowed_refs: AllowedRefs, - #[serde(rename = "allowedRefsEntityUid")] allowed_refs_entity_uid: Option, - #[serde(rename = "allowedRefTags")] allowed_ref_tags: Vec, - #[serde(rename = "allowOutOfLevelRef")] allow_out_of_level_ref: bool, /// Array max length - #[serde(rename = "arrayMaxLength")] array_max_length: Option, /// Array min length - #[serde(rename = "arrayMinLength")] array_min_length: Option, - #[serde(rename = "autoChainRef")] auto_chain_ref: bool, /// TRUE if the value can be null. For arrays, TRUE means it can contain null values /// (exception: array of Points can't have null values). - #[serde(rename = "canBeNull")] can_be_null: bool, /// Default value if selected value is null or invalid. - #[serde(rename = "defaultOverride")] default_override: Option, /// User defined documentation for this field to provide help/tips to level designers about /// accepted values. - #[serde(rename = "doc")] doc: Option, - #[serde(rename = "editorAlwaysShow")] editor_always_show: bool, - #[serde(rename = "editorCutLongValues")] editor_cut_long_values: bool, + editor_display_color: Option, + /// Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `LevelTile`, /// `Points`, `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`, /// `ArrayCountWithLabel`, `ArrayCountNoLabel`, `RefLinkBetweenPivots`, /// `RefLinkBetweenCenters` - #[serde(rename = "editorDisplayMode")] editor_display_mode: EditorDisplayMode, /// Possible values: `Above`, `Center`, `Beneath` - #[serde(rename = "editorDisplayPos")] editor_display_pos: EditorDisplayPos, - #[serde(rename = "editorDisplayScale")] editor_display_scale: f64, /// Possible values: `ZigZag`, `StraightArrow`, `CurvedArrow`, `ArrowsLine`, `DashedLine` - #[serde(rename = "editorLinkStyle")] editor_link_style: EditorLinkStyle, - #[serde(rename = "editorShowInWorld")] editor_show_in_world: bool, - #[serde(rename = "editorTextPrefix")] editor_text_prefix: Option, - #[serde(rename = "editorTextSuffix")] editor_text_suffix: Option, /// User defined unique identifier - #[serde(rename = "identifier")] identifier: String, /// TRUE if the value is an array of multiple values - #[serde(rename = "isArray")] is_array: bool, /// Max limit for value, if applicable - #[serde(rename = "max")] max: Option, /// Min limit for value, if applicable - #[serde(rename = "min")] min: Option, /// Optional regular expression that needs to be matched to accept values. Expected format: /// `/some_reg_ex/g`, with optional "i" flag. - #[serde(rename = "regex")] regex: Option, - #[serde(rename = "symmetricalRef")] symmetrical_ref: bool, /// Possible values: <`null`>, `LangPython`, `LangRuby`, `LangJS`, `LangLua`, `LangC`, /// `LangHaxe`, `LangMarkdown`, `LangJson`, `LangXml`, `LangLog` - #[serde(rename = "textLanguageMode")] text_language_mode: Option, /// UID of the tileset used for a Tile - #[serde(rename = "tilesetUid")] tileset_uid: Option, /// Internal enum representing the possible field types. Possible values: F_Int, F_Float, @@ -513,71 +437,250 @@ pub struct FieldDefinition { purple_type: String, /// Unique Int identifier - #[serde(rename = "uid")] uid: i64, /// If TRUE, the color associated with this field will override the Entity or Level default /// color in the editor UI. For Enum fields, this would be the color associated to their /// values. - #[serde(rename = "useForSmartColor")] use_for_smart_color: bool, } +/// Possible values: `Any`, `OnlySame`, `OnlyTags`, `OnlySpecificEntity` +#[derive(Serialize, Deserialize)] +pub enum AllowedRefs { + Any, + + #[serde(rename = "OnlySame")] + OnlySame, + + #[serde(rename = "OnlySpecificEntity")] + OnlySpecificEntity, + + #[serde(rename = "OnlyTags")] + OnlyTags, +} + +/// Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `LevelTile`, +/// `Points`, `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`, +/// `ArrayCountWithLabel`, `ArrayCountNoLabel`, `RefLinkBetweenPivots`, +/// `RefLinkBetweenCenters` +#[derive(Serialize, Deserialize)] +pub enum EditorDisplayMode { + #[serde(rename = "ArrayCountNoLabel")] + ArrayCountNoLabel, + + #[serde(rename = "ArrayCountWithLabel")] + ArrayCountWithLabel, + + #[serde(rename = "EntityTile")] + EntityTile, + + Hidden, + + #[serde(rename = "LevelTile")] + LevelTile, + + #[serde(rename = "NameAndValue")] + NameAndValue, + + #[serde(rename = "PointPath")] + PointPath, + + #[serde(rename = "PointPathLoop")] + PointPathLoop, + + #[serde(rename = "PointStar")] + PointStar, + + Points, + + #[serde(rename = "RadiusGrid")] + RadiusGrid, + + #[serde(rename = "RadiusPx")] + RadiusPx, + + #[serde(rename = "RefLinkBetweenCenters")] + RefLinkBetweenCenters, + + #[serde(rename = "RefLinkBetweenPivots")] + RefLinkBetweenPivots, + + #[serde(rename = "ValueOnly")] + ValueOnly, +} + +/// Possible values: `Above`, `Center`, `Beneath` +#[derive(Serialize, Deserialize)] +pub enum EditorDisplayPos { + Above, + + Beneath, + + Center, +} + +/// Possible values: `ZigZag`, `StraightArrow`, `CurvedArrow`, `ArrowsLine`, `DashedLine` +#[derive(Serialize, Deserialize)] +pub enum EditorLinkStyle { + #[serde(rename = "ArrowsLine")] + ArrowsLine, + + #[serde(rename = "CurvedArrow")] + CurvedArrow, + + #[serde(rename = "DashedLine")] + DashedLine, + + #[serde(rename = "StraightArrow")] + StraightArrow, + + #[serde(rename = "ZigZag")] + ZigZag, +} + +#[derive(Serialize, Deserialize)] +pub enum TextLanguageMode { + #[serde(rename = "LangC")] + LangC, + + #[serde(rename = "LangHaxe")] + LangHaxe, + + #[serde(rename = "LangJS")] + LangJs, + + #[serde(rename = "LangJson")] + LangJson, + + #[serde(rename = "LangLog")] + LangLog, + + #[serde(rename = "LangLua")] + LangLua, + + #[serde(rename = "LangMarkdown")] + LangMarkdown, + + #[serde(rename = "LangPython")] + LangPython, + + #[serde(rename = "LangRuby")] + LangRuby, + + #[serde(rename = "LangXml")] + LangXml, +} + +/// Possible values: `DiscardOldOnes`, `PreventAdding`, `MoveLastOne` +#[derive(Serialize, Deserialize)] +pub enum LimitBehavior { + #[serde(rename = "DiscardOldOnes")] + DiscardOldOnes, + + #[serde(rename = "MoveLastOne")] + MoveLastOne, + + #[serde(rename = "PreventAdding")] + PreventAdding, +} + +/// If TRUE, the maxCount is a "per world" limit, if FALSE, it's a "per level". Possible +/// values: `PerLayer`, `PerLevel`, `PerWorld` +#[derive(Serialize, Deserialize)] +pub enum LimitScope { + #[serde(rename = "PerLayer")] + PerLayer, + + #[serde(rename = "PerLevel")] + PerLevel, + + #[serde(rename = "PerWorld")] + PerWorld, +} + +/// Possible values: `Rectangle`, `Ellipse`, `Tile`, `Cross` +#[derive(Serialize, Deserialize)] +pub enum RenderMode { + Cross, + + Ellipse, + + Rectangle, + + Tile, +} + /// This object represents a custom sub rectangle in a Tileset image. #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct TilesetRectangle { /// Height in pixels - #[serde(rename = "h")] h: i64, /// UID of the tileset - #[serde(rename = "tilesetUid")] tileset_uid: i64, /// Width in pixels - #[serde(rename = "w")] w: i64, /// X pixels coordinate of the top-left corner in the Tileset image - #[serde(rename = "x")] x: i64, /// Y pixels coordinate of the top-left corner in the Tileset image - #[serde(rename = "y")] y: i64, } +/// An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible +/// values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, +/// `FullSizeUncropped`, `NineSlice` +#[derive(Serialize, Deserialize)] +pub enum TileRenderMode { + Cover, + + #[serde(rename = "FitInside")] + FitInside, + + #[serde(rename = "FullSizeCropped")] + FullSizeCropped, + + #[serde(rename = "FullSizeUncropped")] + FullSizeUncropped, + + #[serde(rename = "NineSlice")] + NineSlice, + + Repeat, + + Stretch, +} + #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct EnumDefinition { - #[serde(rename = "externalFileChecksum")] external_file_checksum: Option, /// Relative path to the external file providing this Enum - #[serde(rename = "externalRelPath")] external_rel_path: Option, /// Tileset UID if provided - #[serde(rename = "iconTilesetUid")] icon_tileset_uid: Option, /// User defined unique identifier - #[serde(rename = "identifier")] identifier: String, /// An array of user-defined tags to organize the Enums - #[serde(rename = "tags")] tags: Vec, /// Unique Int identifier - #[serde(rename = "uid")] uid: i64, /// All possible enum values, with their optional Tile infos. - #[serde(rename = "values")] values: Vec, } #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct EnumValueDefinition { /// **WARNING**: this deprecated value will be *removed* completely on version 1.4.0+ /// Replaced by: `tileRect` @@ -585,138 +688,110 @@ pub struct EnumValueDefinition { tile_src_rect: Option>, /// Optional color - #[serde(rename = "color")] color: i64, /// Enum value - #[serde(rename = "id")] id: String, /// **WARNING**: this deprecated value will be *removed* completely on version 1.4.0+ /// Replaced by: `tileRect` - #[serde(rename = "tileId")] tile_id: Option, /// Optional tileset rectangle to represents this value - #[serde(rename = "tileRect")] tile_rect: Option, } #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct LayerDefinition { /// Type of the layer (*IntGrid, Entities, Tiles or AutoLayer*) #[serde(rename = "__type")] layer_definition_type: String, /// Contains all the auto-layer rule definitions. - #[serde(rename = "autoRuleGroups")] auto_rule_groups: Vec, - #[serde(rename = "autoSourceLayerDefUid")] auto_source_layer_def_uid: Option, /// **WARNING**: this deprecated value is no longer exported since version 1.2.0 Replaced /// by: `tilesetDefUid` - #[serde(rename = "autoTilesetDefUid")] auto_tileset_def_uid: Option, /// Allow editor selections when the layer is not currently active. - #[serde(rename = "canSelectWhenInactive")] can_select_when_inactive: bool, /// Opacity of the layer (0 to 1.0) - #[serde(rename = "displayOpacity")] display_opacity: f64, /// User defined documentation for this element to provide help/tips to level designers. - #[serde(rename = "doc")] doc: Option, /// An array of tags to forbid some Entities in this layer - #[serde(rename = "excludedTags")] excluded_tags: Vec, /// Width and height of the grid in pixels - #[serde(rename = "gridSize")] grid_size: i64, /// Height of the optional "guide" grid in pixels - #[serde(rename = "guideGridHei")] guide_grid_hei: i64, /// Width of the optional "guide" grid in pixels - #[serde(rename = "guideGridWid")] guide_grid_wid: i64, - #[serde(rename = "hideFieldsWhenInactive")] hide_fields_when_inactive: bool, /// Hide the layer from the list on the side of the editor view. - #[serde(rename = "hideInList")] hide_in_list: bool, /// User defined unique identifier - #[serde(rename = "identifier")] identifier: String, /// Alpha of this layer when it is not the active one. - #[serde(rename = "inactiveOpacity")] inactive_opacity: f64, /// An array that defines extra optional info for each IntGrid value.
WARNING: the /// array order is not related to actual IntGrid values! As user can re-order IntGrid values /// freely, you may value "2" before value "1" in this array. - #[serde(rename = "intGridValues")] int_grid_values: Vec, /// Parallax horizontal factor (from -1 to 1, defaults to 0) which affects the scrolling /// speed of this layer, creating a fake 3D (parallax) effect. - #[serde(rename = "parallaxFactorX")] parallax_factor_x: f64, /// Parallax vertical factor (from -1 to 1, defaults to 0) which affects the scrolling speed /// of this layer, creating a fake 3D (parallax) effect. - #[serde(rename = "parallaxFactorY")] parallax_factor_y: f64, /// If true (default), a layer with a parallax factor will also be scaled up/down accordingly. - #[serde(rename = "parallaxScaling")] parallax_scaling: bool, /// X offset of the layer, in pixels (IMPORTANT: this should be added to the `LayerInstance` /// optional offset) - #[serde(rename = "pxOffsetX")] px_offset_x: i64, /// Y offset of the layer, in pixels (IMPORTANT: this should be added to the `LayerInstance` /// optional offset) - #[serde(rename = "pxOffsetY")] px_offset_y: i64, /// If TRUE, the content of this layer will be used when rendering levels in a simplified way /// for the world view - #[serde(rename = "renderInWorldView")] render_in_world_view: bool, /// An array of tags to filter Entities that can be added to this layer - #[serde(rename = "requiredTags")] required_tags: Vec, /// If the tiles are smaller or larger than the layer grid, the pivot value will be used to /// position the tile relatively its grid cell. - #[serde(rename = "tilePivotX")] tile_pivot_x: f64, /// If the tiles are smaller or larger than the layer grid, the pivot value will be used to /// position the tile relatively its grid cell. - #[serde(rename = "tilePivotY")] tile_pivot_y: f64, /// Reference to the default Tileset UID being used by this layer definition.
/// **WARNING**: some layer *instances* might use a different tileset. So most of the time, /// you should probably use the `__tilesetDefUid` value found in layer instances.
Note: /// since version 1.0.0, the old `autoTilesetDefUid` was removed and merged into this value. - #[serde(rename = "tilesetDefUid")] tileset_def_uid: Option, /// Type of the layer as Haxe Enum Possible values: `IntGrid`, `Entities`, `Tiles`, @@ -725,36 +800,28 @@ pub struct LayerDefinition { purple_type: Type, /// User defined color for the UI - #[serde(rename = "uiColor")] ui_color: Option, /// Unique Int identifier - #[serde(rename = "uid")] uid: i64, } #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct AutoLayerRuleGroup { - #[serde(rename = "active")] active: bool, /// *This field was removed in 1.0.0 and should no longer be used.* - #[serde(rename = "collapsed")] collapsed: Option, - #[serde(rename = "isOptional")] is_optional: bool, - #[serde(rename = "name")] name: String, - #[serde(rename = "rules")] rules: Vec, - #[serde(rename = "uid")] uid: i64, - #[serde(rename = "usesWizard")] uses_wizard: bool, } @@ -762,143 +829,145 @@ pub struct AutoLayerRuleGroup { /// completely resolved internally by the editor before any saving. You should just ignore /// this part. #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct AutoLayerRuleDefinition { /// If FALSE, the rule effect isn't applied, and no tiles are generated. - #[serde(rename = "active")] active: bool, - #[serde(rename = "alpha")] alpha: f64, /// When TRUE, the rule will prevent other rules to be applied in the same cell if it matches /// (TRUE by default). - #[serde(rename = "breakOnMatch")] break_on_match: bool, /// Chances for this rule to be applied (0 to 1) - #[serde(rename = "chance")] chance: f64, /// Checker mode Possible values: `None`, `Horizontal`, `Vertical` - #[serde(rename = "checker")] checker: Checker, /// If TRUE, allow rule to be matched by flipping its pattern horizontally - #[serde(rename = "flipX")] flip_x: bool, /// If TRUE, allow rule to be matched by flipping its pattern vertically - #[serde(rename = "flipY")] flip_y: bool, /// Default IntGrid value when checking cells outside of level bounds - #[serde(rename = "outOfBoundsValue")] out_of_bounds_value: Option, /// Rule pattern (size x size) - #[serde(rename = "pattern")] pattern: Vec, /// If TRUE, enable Perlin filtering to only apply rule on specific random area - #[serde(rename = "perlinActive")] perlin_active: bool, - #[serde(rename = "perlinOctaves")] perlin_octaves: f64, - #[serde(rename = "perlinScale")] perlin_scale: f64, - #[serde(rename = "perlinSeed")] perlin_seed: f64, /// X pivot of a tile stamp (0-1) - #[serde(rename = "pivotX")] pivot_x: f64, /// Y pivot of a tile stamp (0-1) - #[serde(rename = "pivotY")] pivot_y: f64, /// Pattern width & height. Should only be 1,3,5 or 7. - #[serde(rename = "size")] size: i64, /// Array of all the tile IDs. They are used randomly or as stamps, based on `tileMode` value. - #[serde(rename = "tileIds")] tile_ids: Vec, /// Defines how tileIds array is used Possible values: `Single`, `Stamp` - #[serde(rename = "tileMode")] tile_mode: TileMode, /// Max random offset for X tile pos - #[serde(rename = "tileRandomXMax")] tile_random_x_max: i64, /// Min random offset for X tile pos - #[serde(rename = "tileRandomXMin")] tile_random_x_min: i64, /// Max random offset for Y tile pos - #[serde(rename = "tileRandomYMax")] tile_random_y_max: i64, /// Min random offset for Y tile pos - #[serde(rename = "tileRandomYMin")] tile_random_y_min: i64, /// Tile X offset - #[serde(rename = "tileXOffset")] tile_x_offset: i64, /// Tile Y offset - #[serde(rename = "tileYOffset")] tile_y_offset: i64, /// Unique Int identifier - #[serde(rename = "uid")] uid: i64, /// X cell coord modulo - #[serde(rename = "xModulo")] x_modulo: i64, /// X cell start offset - #[serde(rename = "xOffset")] x_offset: i64, /// Y cell coord modulo - #[serde(rename = "yModulo")] y_modulo: i64, /// Y cell start offset - #[serde(rename = "yOffset")] y_offset: i64, } +/// Checker mode Possible values: `None`, `Horizontal`, `Vertical` +#[derive(Serialize, Deserialize)] +pub enum Checker { + Horizontal, + + None, + + Vertical, +} + +/// Defines how tileIds array is used Possible values: `Single`, `Stamp` +#[derive(Serialize, Deserialize)] +pub enum TileMode { + Single, + + Stamp, +} + /// IntGrid value definition #[derive(Serialize, Deserialize)] pub struct IntGridValueDefinition { - #[serde(rename = "color")] color: String, /// User defined unique identifier - #[serde(rename = "identifier")] identifier: Option, - #[serde(rename = "tile")] tile: Option, /// The IntGrid value itself - #[serde(rename = "value")] value: i64, } +/// Type of the layer as Haxe Enum Possible values: `IntGrid`, `Entities`, `Tiles`, +/// `AutoLayer` +#[derive(Serialize, Deserialize)] +pub enum Type { + #[serde(rename = "AutoLayer")] + AutoLayer, + + Entities, + + #[serde(rename = "IntGrid")] + IntGrid, + + Tiles, +} + /// The `Tileset` definition is the most important part among project definitions. It /// contains some extra informations about each integrated tileset. If you only had to parse /// one definition section, that would be the one. #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct TilesetDefinition { /// Grid-based height #[serde(rename = "__cHei")] @@ -910,173 +979,159 @@ pub struct TilesetDefinition { /// The following data is used internally for various optimizations. It's always synced with /// source image changes. - #[serde(rename = "cachedPixelData")] cached_pixel_data: Option>>, /// An array of custom tile metadata - #[serde(rename = "customData")] custom_data: Vec, /// If this value is set, then it means that this atlas uses an internal LDtk atlas image /// instead of a loaded one. Possible values: <`null`>, `LdtkIcons` - #[serde(rename = "embedAtlas")] embed_atlas: Option, /// Tileset tags using Enum values specified by `tagsSourceEnumId`. This array contains 1 /// element per Enum value, which contains an array of all Tile IDs that are tagged with it. - #[serde(rename = "enumTags")] enum_tags: Vec, /// User defined unique identifier - #[serde(rename = "identifier")] identifier: String, /// Distance in pixels from image borders - #[serde(rename = "padding")] padding: i64, /// Image height in pixels - #[serde(rename = "pxHei")] px_hei: i64, /// Image width in pixels - #[serde(rename = "pxWid")] px_wid: i64, /// Path to the source file, relative to the current project JSON file
It can be null /// if no image was provided, or when using an embed atlas. - #[serde(rename = "relPath")] rel_path: Option, /// Array of group of tiles selections, only meant to be used in the editor - #[serde(rename = "savedSelections")] saved_selections: Vec>>, /// Space in pixels between all tiles - #[serde(rename = "spacing")] spacing: i64, /// An array of user-defined tags to organize the Tilesets - #[serde(rename = "tags")] tags: Vec, /// Optional Enum definition UID used for this tileset meta-data - #[serde(rename = "tagsSourceEnumUid")] tags_source_enum_uid: Option, - #[serde(rename = "tileGridSize")] tile_grid_size: i64, /// Unique Intidentifier - #[serde(rename = "uid")] uid: i64, } /// In a tileset definition, user defined meta-data of a tile. #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct TileCustomMetadata { - #[serde(rename = "data")] data: String, - #[serde(rename = "tileId")] tile_id: i64, } +#[derive(Serialize, Deserialize)] +pub enum EmbedAtlas { + #[serde(rename = "LdtkIcons")] + LdtkIcons, +} + /// In a tileset definition, enum based tag infos #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct EnumTagValue { - #[serde(rename = "enumValueId")] enum_value_id: String, - #[serde(rename = "tileIds")] tile_ids: Vec, } -/// This object is not actually used by LDtk. It ONLY exists to force explicit references to -/// all types, to make sure QuickType finds them and integrate all of them. Otherwise, -/// Quicktype will drop types that are not explicitely used. #[derive(Serialize, Deserialize)] -pub struct ForcedRefs { - #[serde(rename = "AutoLayerRuleGroup")] - auto_layer_rule_group: Option, +pub enum Flag { + #[serde(rename = "DiscardPreCsvIntGrid")] + DiscardPreCsvIntGrid, + + #[serde(rename = "ExportPreCsvIntGridFormat")] + ExportPreCsvIntGridFormat, + + #[serde(rename = "IgnoreBackupSuggest")] + IgnoreBackupSuggest, + + #[serde(rename = "MultiWorlds")] + MultiWorlds, + + #[serde(rename = "PrependIndexToLevelFileNames")] + PrependIndexToLevelFileNames, + + #[serde(rename = "UseMultilinesType")] + UseMultilinesType, +} + +/// This object is not actually used by LDtk. It ONLY exists to force explicit references to +/// all types, to make sure QuickType finds them and integrate all of them. Otherwise, +/// Quicktype will drop types that are not explicitely used. +#[derive(Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct ForcedRefs { + auto_layer_rule_group: Option, - #[serde(rename = "AutoRuleDef")] auto_rule_def: Option, - #[serde(rename = "CustomCommand")] custom_command: Option, - #[serde(rename = "Definitions")] definitions: Option, - #[serde(rename = "EntityDef")] entity_def: Option, - #[serde(rename = "EntityInstance")] entity_instance: Option, - #[serde(rename = "EntityReferenceInfos")] entity_reference_infos: Option, - #[serde(rename = "EnumDef")] enum_def: Option, - #[serde(rename = "EnumDefValues")] enum_def_values: Option, - #[serde(rename = "EnumTagValue")] enum_tag_value: Option, - #[serde(rename = "FieldDef")] field_def: Option, - #[serde(rename = "FieldInstance")] field_instance: Option, - #[serde(rename = "GridPoint")] grid_point: Option, - #[serde(rename = "IntGridValueDef")] int_grid_value_def: Option, - #[serde(rename = "IntGridValueInstance")] int_grid_value_instance: Option, - #[serde(rename = "LayerDef")] layer_def: Option, - #[serde(rename = "LayerInstance")] layer_instance: Option, - #[serde(rename = "Level")] level: Option, - #[serde(rename = "LevelBgPosInfos")] level_bg_pos_infos: Option, - #[serde(rename = "NeighbourLevel")] neighbour_level: Option, - #[serde(rename = "TableOfContentEntry")] table_of_content_entry: Option, - #[serde(rename = "Tile")] tile: Option, - #[serde(rename = "TileCustomMetadata")] tile_custom_metadata: Option, - #[serde(rename = "TilesetDef")] tileset_def: Option, - #[serde(rename = "TilesetRect")] tileset_rect: Option, - #[serde(rename = "World")] world: Option, } #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct EntityInstance { /// Grid-based coordinates (`[x,y]` format) #[serde(rename = "__grid")] @@ -1105,34 +1160,29 @@ pub struct EntityInstance { tile: Option, /// Reference of the **Entity definition** UID - #[serde(rename = "defUid")] def_uid: i64, /// An array of all custom fields and their values. - #[serde(rename = "fieldInstances")] field_instances: Vec, /// Entity height in pixels. For non-resizable entities, it will be the same as Entity /// definition. - #[serde(rename = "height")] height: i64, /// Unique instance identifier - #[serde(rename = "iid")] iid: String, /// Pixel coordinates (`[x,y]` format) in current level coordinate space. Don't forget /// optional layer offsets, if they exist! - #[serde(rename = "px")] px: Vec, /// Entity width in pixels. For non-resizable entities, it will be the same as Entity /// definition. - #[serde(rename = "width")] width: i64, } #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct FieldInstance { /// Field definition identifier #[serde(rename = "__identifier")] @@ -1162,31 +1212,26 @@ pub struct FieldInstance { value: Option, /// Reference of the **Field definition** UID - #[serde(rename = "defUid")] def_uid: i64, /// Editor internal raw values - #[serde(rename = "realEditorValues")] real_editor_values: Vec>, } /// This object describes the "location" of an Entity instance in the project worlds. #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct ReferenceToAnEntityInstance { /// IID of the refered EntityInstance - #[serde(rename = "entityIid")] entity_iid: String, /// IID of the LayerInstance containing the refered EntityInstance - #[serde(rename = "layerIid")] layer_iid: String, /// IID of the Level containing the refered EntityInstance - #[serde(rename = "levelIid")] level_iid: String, /// IID of the World containing the refered EntityInstance - #[serde(rename = "worldIid")] world_iid: String, } @@ -1194,27 +1239,25 @@ pub struct ReferenceToAnEntityInstance { #[derive(Serialize, Deserialize)] pub struct GridPoint { /// X grid-based coordinate - #[serde(rename = "cx")] cx: i64, /// Y grid-based coordinate - #[serde(rename = "cy")] cy: i64, } /// IntGrid value instance #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct IntGridValueInstance { /// Coordinate ID in the layer grid - #[serde(rename = "coordId")] coord_id: i64, /// IntGrid value - #[serde(rename = "v")] v: i64, } #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct LayerInstance { /// Grid-based height #[serde(rename = "__cHei")] @@ -1260,66 +1303,52 @@ pub struct LayerInstance { /// in display order (ie. 1st tile is beneath 2nd, which is beneath 3rd etc.).

/// Note: if multiple tiles are stacked in the same cell as the result of different rules, /// all tiles behind opaque ones will be discarded. - #[serde(rename = "autoLayerTiles")] auto_layer_tiles: Vec, - #[serde(rename = "entityInstances")] entity_instances: Vec, - #[serde(rename = "gridTiles")] grid_tiles: Vec, /// Unique layer instance identifier - #[serde(rename = "iid")] iid: String, /// **WARNING**: this deprecated value is no longer exported since version 1.0.0 Replaced /// by: `intGridCsv` - #[serde(rename = "intGrid")] int_grid: Option>, /// A list of all values in the IntGrid layer, stored in CSV format (Comma Separated /// Values).
Order is from left to right, and top to bottom (ie. first row from left to /// right, followed by second row, etc).
`0` means "empty cell" and IntGrid values /// start at 1.
The array size is `__cWid` x `__cHei` cells. - #[serde(rename = "intGridCsv")] int_grid_csv: Vec, /// Reference the Layer definition UID - #[serde(rename = "layerDefUid")] layer_def_uid: i64, /// Reference to the UID of the level containing this layer instance - #[serde(rename = "levelId")] level_id: i64, /// An Array containing the UIDs of optional rules that were enabled in this specific layer /// instance. - #[serde(rename = "optionalRules")] optional_rules: Vec, /// This layer can use another tileset by overriding the tileset UID here. - #[serde(rename = "overrideTilesetUid")] override_tileset_uid: Option, /// X offset in pixels to render this layer, usually 0 (IMPORTANT: this should be added to /// the `LayerDef` optional offset, so you should probably prefer using `__pxTotalOffsetX` /// which contains the total offset value) - #[serde(rename = "pxOffsetX")] px_offset_x: i64, /// Y offset in pixels to render this layer, usually 0 (IMPORTANT: this should be added to /// the `LayerDef` optional offset, so you should probably prefer using `__pxTotalOffsetX` /// which contains the total offset value) - #[serde(rename = "pxOffsetY")] px_offset_y: i64, /// Random seed used for Auto-Layers rendering - #[serde(rename = "seed")] seed: i64, /// Layer instance visibility - #[serde(rename = "visible")] visible: bool, } @@ -1327,31 +1356,25 @@ pub struct LayerInstance { #[derive(Serialize, Deserialize)] pub struct TileInstance { /// Alpha/opacity of the tile (0-1, defaults to 1) - #[serde(rename = "a")] a: f64, /// Internal data used by the editor.
For auto-layer tiles: `[ruleId, coordId]`.
/// For tile-layer tiles: `[coordId]`. - #[serde(rename = "d")] d: Vec, /// "Flip bits", a 2-bits integer to represent the mirror transformations of the tile.
/// - Bit 0 = X flip
- Bit 1 = Y flip
Examples: f=0 (no flip), f=1 (X flip /// only), f=2 (Y flip only), f=3 (both flips) - #[serde(rename = "f")] f: i64, /// Pixel coordinates of the tile in the **layer** (`[x,y]` format). Don't forget optional /// layer offsets, if they exist! - #[serde(rename = "px")] px: Vec, /// Pixel coordinates of the tile in the **tileset** (`[x,y]` format) - #[serde(rename = "src")] src: Vec, /// The *Tile ID* in the corresponding tileset. - #[serde(rename = "t")] t: i64, } @@ -1364,6 +1387,7 @@ pub struct TileInstance { /// `externalRelPath` string points to the `ldtkl` file. A `ldtkl` file is just a JSON file /// containing exactly what is described below. #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct Level { /// Background color of the level (same as `bgColor`, except the default value is /// automatically used here if its value is `null`) @@ -1391,11 +1415,9 @@ pub struct Level { level_bg_color: Option, /// Background image X pivot (0-1) - #[serde(rename = "bgPivotX")] bg_pivot_x: f64, /// Background image Y pivot (0-1) - #[serde(rename = "bgPivotY")] bg_pivot_y: f64, /// An enum defining the way the background image (if any) is positioned on the level. See @@ -1405,113 +1427,108 @@ pub struct Level { level_bg_pos: Option, /// The *optional* relative path to the level background image. - #[serde(rename = "bgRelPath")] bg_rel_path: Option, /// This value is not null if the project option "*Save levels separately*" is enabled. In /// this case, this **relative** path points to the level Json file. - #[serde(rename = "externalRelPath")] external_rel_path: Option, /// An array containing this level custom field values. - #[serde(rename = "fieldInstances")] field_instances: Vec, /// User defined unique identifier - #[serde(rename = "identifier")] identifier: String, /// Unique instance identifier - #[serde(rename = "iid")] iid: String, /// An array containing all Layer instances. **IMPORTANT**: if the project option "*Save /// levels separately*" is enabled, this field will be `null`.
This array is **sorted /// in display order**: the 1st layer is the top-most and the last is behind. - #[serde(rename = "layerInstances")] layer_instances: Option>, /// Height of the level in pixels - #[serde(rename = "pxHei")] px_hei: i64, /// Width of the level in pixels - #[serde(rename = "pxWid")] px_wid: i64, /// Unique Int identifier - #[serde(rename = "uid")] uid: i64, /// If TRUE, the level identifier will always automatically use the naming pattern as defined /// in `Project.levelNamePattern`. Becomes FALSE if the identifier is manually modified by /// user. - #[serde(rename = "useAutoIdentifier")] use_auto_identifier: bool, /// Index that represents the "depth" of the level in the world. Default is 0, greater means /// "above", lower means "below".
This value is mostly used for display only and is /// intended to make stacking of levels easier to manage. - #[serde(rename = "worldDepth")] world_depth: i64, /// World X coordinate in pixels.
Only relevant for world layouts where level spatial /// positioning is manual (ie. GridVania, Free). For Horizontal and Vertical layouts, the /// value is always -1 here. - #[serde(rename = "worldX")] world_x: i64, /// World Y coordinate in pixels.
Only relevant for world layouts where level spatial /// positioning is manual (ie. GridVania, Free). For Horizontal and Vertical layouts, the /// value is always -1 here. - #[serde(rename = "worldY")] world_y: i64, } /// Level background image position info #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct LevelBackgroundPosition { /// An array of 4 float values describing the cropped sub-rectangle of the displayed /// background image. This cropping happens when original is larger than the level bounds. /// Array format: `[ cropX, cropY, cropWidth, cropHeight ]` - #[serde(rename = "cropRect")] crop_rect: Vec, /// An array containing the `[scaleX,scaleY]` values of the **cropped** background image, /// depending on `bgPos` option. - #[serde(rename = "scale")] scale: Vec, /// An array containing the `[x,y]` pixel coordinates of the top-left corner of the /// **cropped** background image, depending on `bgPos` option. - #[serde(rename = "topLeftPx")] top_left_px: Vec, } +#[derive(Serialize, Deserialize)] +pub enum BgPos { + Contain, + + Cover, + + #[serde(rename = "CoverDirty")] + CoverDirty, + + Repeat, + + Unscaled, +} + /// Nearby level info #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct NeighbourLevel { /// A single lowercase character tipping on the level location (`n`orth, `s`outh, `w`est, /// `e`ast). - #[serde(rename = "dir")] dir: String, /// Neighbour Instance Identifier - #[serde(rename = "levelIid")] level_iid: String, /// **WARNING**: this deprecated value is no longer exported since version 1.2.0 Replaced /// by: `levelIid` - #[serde(rename = "levelUid")] level_uid: Option, } #[derive(Serialize, Deserialize)] pub struct LdtkTableOfContentEntry { - #[serde(rename = "identifier")] identifier: String, - #[serde(rename = "instances")] instances: Vec, } @@ -1519,350 +1536,38 @@ pub struct LdtkTableOfContentEntry { /// importers, for when it will be officially available. A World contains multiple levels, /// and it has its own layout settings. #[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct World { /// Default new level height - #[serde(rename = "defaultLevelHeight")] default_level_height: i64, /// Default new level width - #[serde(rename = "defaultLevelWidth")] default_level_width: i64, /// User defined unique identifier - #[serde(rename = "identifier")] identifier: String, /// Unique instance identifer - #[serde(rename = "iid")] iid: String, /// All levels from this world. The order of this array is only relevant in /// `LinearHorizontal` and `linearVertical` world layouts (see `worldLayout` value). /// Otherwise, you should refer to the `worldX`,`worldY` coordinates of each Level. - #[serde(rename = "levels")] levels: Vec, /// Height of the world grid in pixels. - #[serde(rename = "worldGridHeight")] world_grid_height: i64, /// Width of the world grid in pixels. - #[serde(rename = "worldGridWidth")] world_grid_width: i64, /// An enum that describes how levels are organized in this project (ie. linearly or in a 2D /// space). Possible values: `Free`, `GridVania`, `LinearHorizontal`, `LinearVertical`, `null` - #[serde(rename = "worldLayout")] world_layout: Option, } -/// Possible values: `Manual`, `AfterLoad`, `BeforeSave`, `AfterSave` -#[derive(Serialize, Deserialize)] -pub enum When { - #[serde(rename = "AfterLoad")] - AfterLoad, - - #[serde(rename = "AfterSave")] - AfterSave, - - #[serde(rename = "BeforeSave")] - BeforeSave, - - #[serde(rename = "Manual")] - Manual, -} - -/// Possible values: `Any`, `OnlySame`, `OnlyTags`, `OnlySpecificEntity` -#[derive(Serialize, Deserialize)] -pub enum AllowedRefs { - #[serde(rename = "Any")] - Any, - - #[serde(rename = "OnlySame")] - OnlySame, - - #[serde(rename = "OnlySpecificEntity")] - OnlySpecificEntity, - - #[serde(rename = "OnlyTags")] - OnlyTags, -} - -/// Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `LevelTile`, -/// `Points`, `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`, -/// `ArrayCountWithLabel`, `ArrayCountNoLabel`, `RefLinkBetweenPivots`, -/// `RefLinkBetweenCenters` -#[derive(Serialize, Deserialize)] -pub enum EditorDisplayMode { - #[serde(rename = "ArrayCountNoLabel")] - ArrayCountNoLabel, - - #[serde(rename = "ArrayCountWithLabel")] - ArrayCountWithLabel, - - #[serde(rename = "EntityTile")] - EntityTile, - - #[serde(rename = "Hidden")] - Hidden, - - #[serde(rename = "LevelTile")] - LevelTile, - - #[serde(rename = "NameAndValue")] - NameAndValue, - - #[serde(rename = "PointPath")] - PointPath, - - #[serde(rename = "PointPathLoop")] - PointPathLoop, - - #[serde(rename = "PointStar")] - PointStar, - - #[serde(rename = "Points")] - Points, - - #[serde(rename = "RadiusGrid")] - RadiusGrid, - - #[serde(rename = "RadiusPx")] - RadiusPx, - - #[serde(rename = "RefLinkBetweenCenters")] - RefLinkBetweenCenters, - - #[serde(rename = "RefLinkBetweenPivots")] - RefLinkBetweenPivots, - - #[serde(rename = "ValueOnly")] - ValueOnly, -} - -/// Possible values: `Above`, `Center`, `Beneath` -#[derive(Serialize, Deserialize)] -pub enum EditorDisplayPos { - #[serde(rename = "Above")] - Above, - - #[serde(rename = "Beneath")] - Beneath, - - #[serde(rename = "Center")] - Center, -} - -/// Possible values: `ZigZag`, `StraightArrow`, `CurvedArrow`, `ArrowsLine`, `DashedLine` -#[derive(Serialize, Deserialize)] -pub enum EditorLinkStyle { - #[serde(rename = "ArrowsLine")] - ArrowsLine, - - #[serde(rename = "CurvedArrow")] - CurvedArrow, - - #[serde(rename = "DashedLine")] - DashedLine, - - #[serde(rename = "StraightArrow")] - StraightArrow, - - #[serde(rename = "ZigZag")] - ZigZag, -} - -#[derive(Serialize, Deserialize)] -pub enum TextLanguageMode { - #[serde(rename = "LangC")] - LangC, - - #[serde(rename = "LangHaxe")] - LangHaxe, - - #[serde(rename = "LangJS")] - LangJs, - - #[serde(rename = "LangJson")] - LangJson, - - #[serde(rename = "LangLog")] - LangLog, - - #[serde(rename = "LangLua")] - LangLua, - - #[serde(rename = "LangMarkdown")] - LangMarkdown, - - #[serde(rename = "LangPython")] - LangPython, - - #[serde(rename = "LangRuby")] - LangRuby, - - #[serde(rename = "LangXml")] - LangXml, -} - -/// Possible values: `DiscardOldOnes`, `PreventAdding`, `MoveLastOne` -#[derive(Serialize, Deserialize)] -pub enum LimitBehavior { - #[serde(rename = "DiscardOldOnes")] - DiscardOldOnes, - - #[serde(rename = "MoveLastOne")] - MoveLastOne, - - #[serde(rename = "PreventAdding")] - PreventAdding, -} - -/// If TRUE, the maxCount is a "per world" limit, if FALSE, it's a "per level". Possible -/// values: `PerLayer`, `PerLevel`, `PerWorld` -#[derive(Serialize, Deserialize)] -pub enum LimitScope { - #[serde(rename = "PerLayer")] - PerLayer, - - #[serde(rename = "PerLevel")] - PerLevel, - - #[serde(rename = "PerWorld")] - PerWorld, -} - -/// Possible values: `Rectangle`, `Ellipse`, `Tile`, `Cross` -#[derive(Serialize, Deserialize)] -pub enum RenderMode { - #[serde(rename = "Cross")] - Cross, - - #[serde(rename = "Ellipse")] - Ellipse, - - #[serde(rename = "Rectangle")] - Rectangle, - - #[serde(rename = "Tile")] - Tile, -} - -/// An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible -/// values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, -/// `FullSizeUncropped`, `NineSlice` -#[derive(Serialize, Deserialize)] -pub enum TileRenderMode { - #[serde(rename = "Cover")] - Cover, - - #[serde(rename = "FitInside")] - FitInside, - - #[serde(rename = "FullSizeCropped")] - FullSizeCropped, - - #[serde(rename = "FullSizeUncropped")] - FullSizeUncropped, - - #[serde(rename = "NineSlice")] - NineSlice, - - #[serde(rename = "Repeat")] - Repeat, - - #[serde(rename = "Stretch")] - Stretch, -} - -/// Checker mode Possible values: `None`, `Horizontal`, `Vertical` -#[derive(Serialize, Deserialize)] -pub enum Checker { - #[serde(rename = "Horizontal")] - Horizontal, - - #[serde(rename = "None")] - None, - - #[serde(rename = "Vertical")] - Vertical, -} - -/// Defines how tileIds array is used Possible values: `Single`, `Stamp` -#[derive(Serialize, Deserialize)] -pub enum TileMode { - #[serde(rename = "Single")] - Single, - - #[serde(rename = "Stamp")] - Stamp, -} - -/// Type of the layer as Haxe Enum Possible values: `IntGrid`, `Entities`, `Tiles`, -/// `AutoLayer` -#[derive(Serialize, Deserialize)] -pub enum Type { - #[serde(rename = "AutoLayer")] - AutoLayer, - - #[serde(rename = "Entities")] - Entities, - - #[serde(rename = "IntGrid")] - IntGrid, - - #[serde(rename = "Tiles")] - Tiles, -} - -#[derive(Serialize, Deserialize)] -pub enum EmbedAtlas { - #[serde(rename = "LdtkIcons")] - LdtkIcons, -} - -#[derive(Serialize, Deserialize)] -pub enum Flag { - #[serde(rename = "DiscardPreCsvIntGrid")] - DiscardPreCsvIntGrid, - - #[serde(rename = "ExportPreCsvIntGridFormat")] - ExportPreCsvIntGridFormat, - - #[serde(rename = "IgnoreBackupSuggest")] - IgnoreBackupSuggest, - - #[serde(rename = "MultiWorlds")] - MultiWorlds, - - #[serde(rename = "PrependIndexToLevelFileNames")] - PrependIndexToLevelFileNames, - - #[serde(rename = "UseMultilinesType")] - UseMultilinesType, -} - -#[derive(Serialize, Deserialize)] -pub enum BgPos { - #[serde(rename = "Contain")] - Contain, - - #[serde(rename = "Cover")] - Cover, - - #[serde(rename = "CoverDirty")] - CoverDirty, - - #[serde(rename = "Repeat")] - Repeat, - - #[serde(rename = "Unscaled")] - Unscaled, -} - #[derive(Serialize, Deserialize)] pub enum WorldLayout { - #[serde(rename = "Free")] Free, #[serde(rename = "GridVania")] @@ -1879,16 +1584,12 @@ pub enum WorldLayout { /// values: `Capitalize`, `Uppercase`, `Lowercase`, `Free` #[derive(Serialize, Deserialize)] pub enum IdentifierStyle { - #[serde(rename = "Capitalize")] Capitalize, - #[serde(rename = "Free")] Free, - #[serde(rename = "Lowercase")] Lowercase, - #[serde(rename = "Uppercase")] Uppercase, } @@ -1899,7 +1600,6 @@ pub enum ImageExportMode { #[serde(rename = "LayersAndLevels")] LayersAndLevels, - #[serde(rename = "None")] None, #[serde(rename = "OneImagePerLayer")]