mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-21 01:13:37 +08:00
Fix label for randomness slider in select window
Add suggestions for texture names in select window
This commit is contained in:
parent
23419d7945
commit
224399b8a3
@ -53,8 +53,9 @@ function buildForm(dialog) {
|
||||
bar.append(input_element)
|
||||
|
||||
if (data.list) {
|
||||
input_element.list = `${dialog.id}_${form_id}_list`;
|
||||
let list = $(`<datalist id="${input_element.list}"></datalist>`);
|
||||
let list_id = `${dialog.id}_${form_id}_list`;
|
||||
input_element.setAttribute('list', list_id);
|
||||
let list = $(`<datalist id="${list_id}"></datalist>`);
|
||||
for (let value of data.list) {
|
||||
let node = document.createElement('option');
|
||||
node.value = value;
|
||||
@ -402,7 +403,7 @@ window.Dialog = class Dialog {
|
||||
if (result === false) return;
|
||||
}
|
||||
if (typeof this.onButton == 'function') {
|
||||
let result = this.onButton(button);
|
||||
let result = this.onButton(button, event);
|
||||
if (result === false) return;
|
||||
}
|
||||
this.hide();
|
||||
|
@ -824,12 +824,12 @@ BARS.defineActions(function() {
|
||||
new: {label: 'dialog.select.new', type: 'checkbox', value: true},
|
||||
group: {label: 'dialog.select.group', type: 'checkbox'},
|
||||
name: {label: 'dialog.select.name', type: 'text'},
|
||||
texture: {label: 'data.texture', type: 'text'},
|
||||
texture: {label: 'data.texture', type: 'text', list: Texture.all.map(tex => tex.name)},
|
||||
color: {label: 'menu.cube.color', type: 'select', value: '-1', options: color_options}
|
||||
},
|
||||
lines: [
|
||||
`<div class="dialog_bar form_bar">
|
||||
<label class="name_space_left tl">dialog.select.random</label>
|
||||
<label class="name_space_left">${tl('dialog.select.random')}</label>
|
||||
<input type="range" min="0" max="100" step="1" value="100" class="tool half" style="width: 100%;" id="selgen_random">
|
||||
</div>`
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user