diff --git a/css/panels.css b/css/panels.css index 703c5ec..bfb258a 100644 --- a/css/panels.css +++ b/css/panels.css @@ -1384,6 +1384,22 @@ color: var(--color-light); cursor: pointer; } + #uv_scale_handle { + width: 20px; + height: 20px; + position: absolute; + text-align: center; + cursor: nw-resize; + z-index: 1; + background-color: var(--color-back); + } + #uv_scale_handle:hover { + color: var(--color-light); + } + #uv_scale_handle i { + transform: scaleY(-1); + font-size: 18px; + } .cube_box_uv { position: absolute; diff --git a/css/window.css b/css/window.css index 79b287a..3c29fdd 100644 --- a/css/window.css +++ b/css/window.css @@ -983,7 +983,7 @@ min-width: 120px; display: inline-block; } - section#quick_setup > div select { + section#quick_setup > div bb-select { flex-grow: 1; } section#quick_setup > div > p { diff --git a/index.html b/index.html index 88ffd9c..c4b2a0e 100644 --- a/index.html +++ b/index.html @@ -87,6 +87,7 @@ + diff --git a/js/interface/dialog.js b/js/interface/dialog.js index 8cd8662..c792c66 100644 --- a/js/interface/dialog.js +++ b/js/interface/dialog.js @@ -1,34 +1,5 @@ (function() { -Vue.component('search-bar', { - props: { - value: String, - hide: Boolean - }, - data() {return { - hidden: this.hide - }}, - methods: { - change(text) { - this.$emit('input', text) - }, - clickIcon() { - if (this.hide && !this.value) { - this.hidden = false; - this.$refs.input.focus(); - } else { - this.value = ''; - this.$emit('input', ''); - } - } - }, - template: ` - ` -}) - function buildForm(dialog) { let dialog_content = $(dialog.object).find('.dialog_content') for (var form_id in dialog.form) { @@ -104,16 +75,43 @@ function buildForm(dialog) { case 'select': - var el = $(`
`) - input_element = el.find('select') - for (var key in data.options) { - var name = tl(data.options[key]) - input_element.append(``) + function getNameFor(key) { + let val = data.options[key]; + if (val) { + return tl(val.name || val); + } else { + return ''; + } } - bar.append(el) - input_element.on('change', () => { - dialog.updateFormValues() + let value = data.value || data.default || Object.keys(data.options)[0]; + let select = Interface.createElement('bb-select', {id: form_id, class: 'half', value: value}, getNameFor(value)); + function setKey(key) { + value = key; + select.setAttribute('value', key); + select.textContent = getNameFor(key); + dialog.updateFormValues(); + } + select.addEventListener('click', function(event) { + if (Menu.closed_in_this_click == form_id) return this; + let items = []; + for (let key in data.options) { + let val = data.options[key]; + if (val) { + items.push({ + name: getNameFor(key), + icon: val.icon || ((value == key) ? 'far.fa-dot-circle' : 'far.fa-circle'), + condition: val.condition, + click: (e) => { + setKey(key); + } + }) + } + } + let menu = new Menu(form_id, items); + menu.node.style['min-width'] = select.clientWidth+'px'; + menu.open(select); }) + bar.append(select) break; @@ -446,6 +444,7 @@ window.Dialog = class Dialog { this.onButton = options.onButton; this.onFormChange = options.onFormChange; this.onOpen = options.onOpen; + this.onBuild = options.onBuild; this.object; } @@ -530,7 +529,7 @@ window.Dialog = class Dialog { result[form_id] = data.bar.find('textarea#'+form_id).val() break; case 'select': - result[form_id] = data.bar.find('select#'+form_id+' > option:selected').attr('id') + result[form_id] = data.bar.find('bb-select#'+form_id).attr('value'); break; case 'radio': result[form_id] = data.bar.find('.form_part_radio#'+form_id+' input:checked').attr('id') @@ -677,6 +676,11 @@ window.Dialog = class Dialog { }) jq_dialog.css('position', 'absolute') } + + if (typeof this.onBuild == 'function') { + this.onBuild(this.object); + } + return this; } show() { diff --git a/js/interface/settings.js b/js/interface/settings.js index 1ac29c1..8de320b 100644 --- a/js/interface/settings.js +++ b/js/interface/settings.js @@ -631,9 +631,7 @@ onVueSetup(function() { diff --git a/js/interface/start_screen.js b/js/interface/start_screen.js index 7d525c9..4040e5c 100644 --- a/js/interface/start_screen.js +++ b/js/interface/start_screen.js @@ -334,6 +334,13 @@ onVueSetup(function() { keymap: 'default', keymap_changed: false, theme: 'dark', + keymap_options: { + default: tl('action.load_keymap.default'), + mouse: tl('action.load_keymap.mouse'), + blender: 'Blender', + cinema4d: 'Cinema 4D', + maya: 'Maya', + }, }}, methods: { tl, @@ -379,20 +386,12 @@ onVueSetup(function() {
- +

{{ tl('action.load_keymap.' + keymap + '.desc') }}

- +
refresh
diff --git a/js/interface/vue_components.js b/js/interface/vue_components.js new file mode 100644 index 0000000..3dd1053 --- /dev/null +++ b/js/interface/vue_components.js @@ -0,0 +1,77 @@ +Vue.component('search-bar', { + props: { + value: String, + hide: Boolean + }, + data() {return { + hidden: this.hide + }}, + methods: { + change(text) { + this.$emit('input', text) + }, + clickIcon() { + if (this.hide && !this.value) { + this.hidden = false; + this.$refs.input.focus(); + } else { + this.value = ''; + this.$emit('input', ''); + } + } + }, + template: ` + ` +}) + +Vue.component('select-input', { + props: { + value: String, + options: Object + }, + data() {return { + id: bbuid(8) + }}, + methods: { + set(value) { + this.value = value; + this.$emit('input', value); + }, + getNameFor(key) { + let val = this.options[key]; + if (val) { + return tl(val.name || val); + } else { + return ''; + } + }, + open(event) { + if (Menu.closed_in_this_click == this.id) return this; + let items = []; + for (let key in this.options) { + let val = this.options[key]; + if (val) { + items.push({ + name: this.getNameFor(key), + icon: val.icon || ((this.value == key) ? 'far.fa-dot-circle' : 'far.fa-circle'), + condition: val.condition, + click: (e) => { + this.set(key); + } + }) + } + } + let menu = new Menu(this.id, items); + menu.node.style['min-width'] = this.$el.clientWidth+'px'; + menu.open(event.target, this); + } + }, + template: ` + + {{ getNameFor(value) }} + + ` +}) \ No newline at end of file diff --git a/js/io/format.js b/js/io/format.js index 71cec36..5d3cf58 100644 --- a/js/io/format.js +++ b/js/io/format.js @@ -232,5 +232,6 @@ new ModelFormat({ optional_box_uv: true, uv_rotation: true, animation_mode: true, + animated_textures: true, locators: true, }) diff --git a/js/io/project.js b/js/io/project.js index 690b8e4..cf6811c 100644 --- a/js/io/project.js +++ b/js/io/project.js @@ -861,7 +861,6 @@ BARS.defineActions(function() { format: { label: 'data.format', type: 'select', - default: Format.id, options, }, },