Skip to content

Commit

Permalink
Support Ldtk file version 1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
sumibi-yakitori committed Apr 25, 2022
1 parent a3a29aa commit 598cc59
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ldtk2"
version = "0.6.0"
version = "0.7.0"
authors = ["sumibi-yakitori <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A thin crate for people who just want to use ldtk files freely.

## Supported LDtk file versions

`^1.0.0`
`^1.1.3`


## Usage
Expand Down
17 changes: 13 additions & 4 deletions src/ldtk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub struct LdtkJsonRoot {
pub identifier_style: IdentifierStyle,

/// "Image export" option when saving project. Possible values: `None`, `OneImagePerLayer`,
/// `OneImagePerLevel`
/// `OneImagePerLevel`, `LayersAndLevels`
#[serde(rename = "imageExportMode")]
pub image_export_mode: ImageExportMode,

Expand Down Expand Up @@ -127,6 +127,11 @@ pub struct LdtkJsonRoot {
#[serde(rename = "pngFilePattern")]
pub png_file_pattern: Option<String>,

/// If TRUE, a very simplified will be generated on saving, for quicker & easier engine
/// integration.
#[serde(rename = "simplifiedExport")]
pub simplified_export: bool,

/// This optional description is used by LDtk Samples to show up some informations and
/// instructions.
#[serde(rename = "tutorialDesc")]
Expand Down Expand Up @@ -797,9 +802,10 @@ pub struct TilesetDefinition {
#[serde(rename = "pxWid")]
pub px_wid: i64,

/// Path to the source file, relative to the current project JSON file
/// Path to the source file, relative to the current project JSON file<br/> It can be null
/// if no image was provided, or when using an embed atlas.
#[serde(rename = "relPath")]
pub rel_path: String,
pub rel_path: Option<String>,

/// Array of group of tiles selections, only meant to be used in the editor
#[serde(rename = "savedSelections")]
Expand Down Expand Up @@ -1681,9 +1687,12 @@ pub enum IdentifierStyle {
}

/// "Image export" option when saving project. Possible values: `None`, `OneImagePerLayer`,
/// `OneImagePerLevel`
/// `OneImagePerLevel`, `LayersAndLevels`
#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum ImageExportMode {
#[serde(rename = "LayersAndLevels")]
LayersAndLevels,

#[serde(rename = "None")]
None,

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//!
//! # Supported LDtk file versions
//!
//! `^1.0.0`
//! `^1.1.3`
//!
//!
//! # Usage
Expand Down

0 comments on commit 598cc59

Please sign in to comment.