diff --git a/index.html b/index.html index 2216069e..73170126 100644 --- a/index.html +++ b/index.html @@ -59,16 +59,16 @@ - -
diff --git a/js/view.js b/js/view.js index c2b29f1b..a379048e 100644 --- a/js/view.js +++ b/js/view.js @@ -412,25 +412,28 @@ function generateObject(data, struct, options) { let hasNoValue = typeof data[field.id] !== 'object'; let arrowDirection = hasNoValue ? 'dropright' : 'dropdown' $body.append(''); + if (hasNoValue && field.values) { + let outValue, $field; + ({out: outValue, component: $field} = generateEnum(data[field.id], field)); + out[field.id] = outValue; + const $selection = $($field.children()[1]); + const $dropdown = $body.children().last(); + $selection.addClass('mt-3'); + $dropdown.addClass('input-group'); + $($dropdown.children()[0]) + .css('border-top-right-radius', '0') + .css('border-bottom-right-radius', '0'); + $selection.attr('data-type', 'enum'); + $selection.attr('data-index', field.id); + $dropdown.append($selection); + } if (field.help) { - $body.find('span').append(generateTooltip(field.translate)); + const $tooltip = generateTooltip(field.translate) + $tooltip.addClass('mt-3') + $body.children().last().append($tooltip); } if (hasNoValue) { - if (field.values) { - let outValue, $field; - ({out: outValue, component: $field} = generateEnum(data[field.id], field)); - out[field.id] = outValue; - const $selection = $($field.children()[1]); - const $dropdown = $body.children().last(); - $selection.addClass('mt-3'); - $dropdown.addClass('input-group'); - $($dropdown.children()[0]) - .css('border-top-right-radius', '0') - .css('border-bottom-right-radius', '0'); - $selection.attr('data-type', 'enum'); - $selection.attr('data-index', field.id); - $dropdown.append($selection); - } else { + if (!field.values) { $body.append(''); } continue; diff --git a/locales/en.json b/locales/en.json index 2e56c9f7..32bfff2c 100644 --- a/locales/en.json +++ b/locales/en.json @@ -35,6 +35,7 @@ "biome.parameters.humidity": "Humidity", "biome_add": "Add Biome", "biome_remove": "Remove Biome", + "biome_source.biome": "Biome", "biome_source.large_biomes": "Large Biomes", "biome_source.preset": "Biomes Preset", "biome_source.seed": "Biomes Seed", @@ -347,6 +348,7 @@ "generator.settings.disable_mob_generation": "Disable Mob Generation", "generator.settings.default_block": "Default Block", "generator.settings.default_fluid": "Default Fluid", + "generator.settings.layers_add": "Add Layer", "generator.settings.noise": "Noise Options", "generator.settings.noise.island_noise_override": "Island Noise Override", "generator.settings.noise.density_factor": "Density Factor", @@ -395,6 +397,9 @@ "item.potion": "Potion", "item.tag": "Item Tag", "item_remove": "Remove Item", + "layer_remove": "Remove Layer", + "layer.block": "Block ID", + "layer.height": "Height", "location.biome": "Biome", "location.block": "Block", "location.block.block": "Block ID", diff --git a/schemas/worldgen.json b/schemas/worldgen.json index 4e9d3048..20284760 100644 --- a/schemas/worldgen.json +++ b/schemas/worldgen.json @@ -91,6 +91,7 @@ "translate": "generator.type", "translateValue": "generator.type", "type": "enum", + "filter": true, "values": [ "minecraft:noise", "minecraft:flat", @@ -112,6 +113,7 @@ "translate": "biome_source.type", "translateValue": "biome_source.type", "type": "enum", + "filter": true, "values": [ "minecraft:fixed", "minecraft:multi_noise", @@ -133,20 +135,44 @@ "unset": true, "values": [ "minecraft:nether" + ], + "require": [ + "minecraft:multi_noise" ] }, { "id": "large_biomes", "translate": "biome_source.large_biomes", - "type": "boolean" + "type": "boolean", + "require": [ + "minecraft:vanilla_layered", + "minecraft:multi_noise", + "minecraft:the_end" + ] }, { "id": "biomes", "translate": "biome", "type": "array", "values": "biome", - "button": "field" + "button": "field", + "require": [ + "minecraft:multi_noise", + "minecraft:checkerboard" + ] + }, + { + "id": "biome", + "translate": "biome_source.biome", + "type": "enum", + "values": "biomes", + "require": [ + "minecraft:fixed" + ] } + ], + "require": [ + "minecraft:noise" ] }, { @@ -338,6 +364,51 @@ } ] } + ], + "require": [ + "minecraft:noise" + ] + }, + { + "id": "settings", + "translate": "generator.settings", + "type": "object", + "color": "dark", + "collapse": true, + "fields": [ + { + "id": "biome", + "translate": "biome_source.biome", + "type": "enum", + "values": "biomes" + }, + { + "id": "layers", + "translate": "generator.settings.layers", + "type": "array", + "values": "layer", + "button": "field" + }, + { + "id": "structures", + "type": "object", + "card": false, + "fields": [ + { + "id": "structures", + "translate": "generator.settings.structures", + "translatePlaceholder": "structure", + "type": "map", + "values": { + "type": "object", + "value": "structure" + } + } + ] + } + ], + "require": [ + "minecraft:flat" ] } ] @@ -464,6 +535,23 @@ "type": "int" } ] + }, + { + "id": "layer", + "type": "object", + "color": "info", + "fields": [ + { + "id": "block", + "translate": "layer.block", + "type": "string" + }, + { + "id": "height", + "translate": "layer.height", + "type": "int" + } + ] } ], "collections": { diff --git a/worldgen/index.html b/worldgen/index.html index 4b7b31f3..e8451ccc 100644 --- a/worldgen/index.html +++ b/worldgen/index.html @@ -18,8 +18,8 @@