mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-04-06 17:31:09 +08:00
parent
e90771e39f
commit
78c27ebdf8
@ -530,6 +530,11 @@ const Settings = {
|
||||
new Setting('hardware_acceleration', {category: 'application', value: true, condition: isApp, launch_setting: true});
|
||||
|
||||
//Export
|
||||
new Setting('json_indentation', {category: 'export', value: 'tabs', type: 'select', options: {
|
||||
tabs: tl('settings.json_indentation.tabs'),
|
||||
spaces_4: tl('settings.json_indentation.spaces_4'),
|
||||
spaces_2: tl('settings.json_indentation.spaces_2'),
|
||||
}});
|
||||
new Setting('minifiedout', {category: 'export', value: false});
|
||||
new Setting('embed_textures', {category: 'export', value: true});
|
||||
new Setting('minify_bbmodel', {category: 'export', value: true});
|
||||
|
13
js/io/io.js
13
js/io/io.js
@ -426,13 +426,20 @@ const Extruder = {
|
||||
}
|
||||
}
|
||||
//Json
|
||||
function compileJSON(object, options) {
|
||||
if (typeof options !== 'object') options = {}
|
||||
function compileJSON(object, options = {}) {
|
||||
let indentation = options.indentation;
|
||||
if (typeof indentation !== 'string') {
|
||||
switch (settings.json_indentation.value) {
|
||||
case 'spaces_4': indentation = ' '; break;
|
||||
case 'spaces_2': indentation = ' '; break;
|
||||
case 'tabs': default: indentation = '\t'; break;
|
||||
}
|
||||
}
|
||||
function newLine(tabs) {
|
||||
if (options.small === true) {return '';}
|
||||
var s = '\n'
|
||||
for (var i = 0; i < tabs; i++) {
|
||||
s += '\t'
|
||||
s += indentation;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -918,6 +918,11 @@
|
||||
|
||||
"settings.dialog.desc": "Show the \"%0\" dialog",
|
||||
|
||||
"settings.json_indentation": "JSON Indentation",
|
||||
"settings.json_indentation.desc": "Indentation style for exported JSON files",
|
||||
"settings.json_indentation.tabs": "Tabs",
|
||||
"settings.json_indentation.spaces_4": "Spaces: 4",
|
||||
"settings.json_indentation.spaces_2": "Spaces: 2",
|
||||
"settings.minifiedout": "Minified Export",
|
||||
"settings.minifiedout.desc": "Write JSON file in one line",
|
||||
"settings.minify_bbmodel": "Minified Project Files",
|
||||
|
Loading…
x
Reference in New Issue
Block a user