Lua export omits position limts if not needed

This commit is contained in:
Wuzzy 2024-11-30 15:20:30 +01:00
parent b7423c152b
commit 17c7df54da
2 changed files with 8 additions and 3 deletions

View File

@ -2288,8 +2288,13 @@ inputExportLua.onclick = function() {
str += ` name = \"${escapedName}\",\n`;
str += ` heat_point = ${biome.heat},\n`;
str += ` humidity_point = ${biome.humidity},\n`;
str += ` min_pos { x = ${biome.min_x}, y = ${biome.min_y}, z = ${biome.min_z} },\n`;
if (biome.min_x !== MIN_X || biome.max_x !== MAX_X || biome.min_z !== MIN_Z || biome.max_z !== MAX_Z) {
str += ` max_pos { x = ${biome.max_x}, y = ${biome.max_y}, z = ${biome.max_z} },\n`;
str += ` min_pos { x = ${biome.min_x}, y = ${biome.min_y}, z = ${biome.min_z} },\n`;
} else if (biome.min_y !== MIN_Y || biome.max_y !== MAX_Y) {
str += ` max_y = ${biome.max_y},\n`;
str += ` min_y = ${biome.min_y},\n`;
}
str += "})\n";
}
exportSectionText.innerText = str;

View File

@ -124,7 +124,7 @@
<p>This allows you to export the current biomes into a text. You can choose to export them in one of various formats. Only biome information is included, not the display settings or noise parameters.</p>
<p>The <b>Lua</b> export gives you a very basic Lua code that can be pasted into an actual Lua mod. The code is very basic and does not include the “landscape materials”, like what the surface is made of (dirt, stone, sand, etc.).</p>
<p>The <b>Lua</b> export gives you a very basic Lua code that can be pasted into an actual Lua mod. The code is very basic and does not include the “landscape materials”, like what the surface is made of (dirt, stone, sand, etc.). Biome coordinate limits (`y_min`/`y_max` or `min_pos`/`max_pos`) are added to the export only if they differ from the default values -31000 and 31000.</p>
<p>The <b>JSON</b> export is a text you can use to import the biomes in LiBPoV later. You may want to copy this into a text file.</p>