diff --git a/app/assets/tpl/editProject.html b/app/assets/tpl/editProject.html index cc19e39e2..01685a105 100644 --- a/app/assets/tpl/editProject.html +++ b/app/assets/tpl/editProject.html @@ -116,15 +116,14 @@

- + - Enable this to save project JSON file without any "pretty" formatting (ie. white spaces and indentation). - This is NOT necessarily recommended if your project is stored on a versioning system (git, svn etc.) because this could cause issues with diffs and merging operations. - Only use this option if you really need to reduce the project files size. + You can adjust the way the JSON file is formated by LDtk (ie. white spaces and indentation). + Only use Minified if you really need to reduce the project files size. This will cause issues with diffs and merging operations.
- +
diff --git a/src/electron.renderer/ui/modal/panel/EditProject.hx b/src/electron.renderer/ui/modal/panel/EditProject.hx index d2a5e2bb1..682f10f21 100644 --- a/src/electron.renderer/ui/modal/panel/EditProject.hx +++ b/src/electron.renderer/ui/modal/panel/EditProject.hx @@ -208,13 +208,29 @@ class EditProject extends ui.modal.Panel { jForms.find(".backupRecommend").css("visibility", project.recommendsBackup() ? "visible" : "hidden"); - // Json minifiying - var i = Input.linkToHtmlInput( project.minifyJson, jForms.find("[name=minify]") ); + // Json style + var jSelect = jForms.find("select#jsonStyle"); + var i = new form.input.EnumSelect( + jSelect, + ldtk.Json.JsonStyle, + ()->project.jsonStyle, + (v)->{ + project.jsonStyle = v; + }, + (v)->switch v { + case Minified: L.t._("MINIFIED (minimal file size, no indentation)"); + case Compact: L.t._("COMPACT (mostly indented, but small arrays are inlined)"); + case Full: L.t._("FULL (fully indented)"); + } + ); i.linkEvent(ProjectSettingsChanged); - i.onChange = ()->{ - editor.invalidateAllLevelsCache; - recommendSaving(); - } + // Json minifiying + // var i = Input.linkToHtmlInput( project.minifyJson, jForms.find("[name=minify]") ); + // i.linkEvent(ProjectSettingsChanged); + // i.onChange = ()->{ + // editor.invalidateAllLevelsCache; + // recommendSaving(); + // } // Simplified format var i = Input.linkToHtmlInput( project.simplifiedExport, jForms.find("[name=simplifiedExport]") );