Fix issue with box UV switching in individual tabs

Downgrade electron to 13 on Linux, fixes #1091
Fix UV editor width on mobile
This commit is contained in:
JannisX11 2021-10-15 12:15:11 +02:00
parent c16c81ca59
commit 4c646d4e69
7 changed files with 20 additions and 24 deletions

View File

@ -27,6 +27,7 @@ jobs:
os: linux os: linux
script: script:
- sudo apt-get install rpm - sudo apt-get install rpm
- npm install electron@13.5.2
- electron-builder --publish=onTagOrDraft - electron-builder --publish=onTagOrDraft
cache: cache:

View File

@ -192,7 +192,9 @@ class Panel {
let show = BARS.condition(this.condition) let show = BARS.condition(this.condition)
if (show) { if (show) {
$(this.node).show() $(this.node).show()
if (Interface.data.left_bar.includes(this.id)) { if (Blockbench.isMobile) {
this.width = this.node.clientWidth;
} else if (Interface.data.left_bar.includes(this.id)) {
this.width = Interface.data.left_bar_width this.width = Interface.data.left_bar_width
} else if (Interface.data.right_bar.includes(this.id)) { } else if (Interface.data.right_bar.includes(this.id)) {
this.width = Interface.data.right_bar_width this.width = Interface.data.right_bar_width

View File

@ -24,7 +24,7 @@ class ModelFormat {
ModelFormat.properties[id].merge(this, data); ModelFormat.properties[id].merge(this, data);
} }
} }
select(converting) { select() {
if (Format && typeof Format.onDeactivation == 'function') { if (Format && typeof Format.onDeactivation == 'function') {
Format.onDeactivation() Format.onDeactivation()
} }
@ -32,9 +32,6 @@ class ModelFormat {
if (typeof this.onActivation == 'function') { if (typeof this.onActivation == 'function') {
Format.onActivation() Format.onActivation()
} }
if (!converting || !this.optional_box_uv) {
Project.box_uv = Format.box_uv;
}
buildGrid() buildGrid()
if (Format.centered_grid) { if (Format.centered_grid) {
scene.position.set(0, 0, 0); scene.position.set(0, 0, 0);
@ -47,12 +44,6 @@ class ModelFormat {
} }
}) })
Interface.Panels.animations.inside_vue._data.animation_files_enabled = this.animation_files; Interface.Panels.animations.inside_vue._data.animation_files_enabled = this.animation_files;
// Todo: toggle animated textures in UV editor
for (var key in ModelProject.properties) {
if (Project[key] == undefined) {
ModelProject.properties[key].reset(Project);
}
}
Interface.status_bar.vue.Format = this; Interface.status_bar.vue.Format = this;
Modes.vue.$forceUpdate() Modes.vue.$forceUpdate()
updateInterfacePanels() updateInterfacePanels()
@ -73,9 +64,12 @@ class ModelFormat {
Project.export_path = ''; Project.export_path = '';
var old_format = Format var old_format = Format
this.select(true) this.select();
Modes.options.edit.select() Modes.options.edit.select()
// Box UV
if (!this.optional_box_uv) Project.box_uv = this.box_uv;
//Bone Rig //Bone Rig
if (!Format.bone_rig && old_format.bone_rig) { if (!Format.bone_rig && old_format.bone_rig) {
Group.all.forEach(group => { Group.all.forEach(group => {

View File

@ -8,7 +8,7 @@ class ModelProject {
this.locked = false; this.locked = false;
this.thumbnail = ''; this.thumbnail = '';
this._box_uv = false; this._box_uv = options.format ? options.format.box_uv : false;
this._texture_width = 16; this._texture_width = 16;
this._texture_height = 16; this._texture_height = 16;
@ -336,7 +336,7 @@ new Property(ModelProject, 'number', 'shadow_size', {
ModelProject.all = []; ModelProject.all = [];
let Project = 0;// = new ModelProject(); let Project = 0;
let ProjectData = {}; let ProjectData = {};

View File

@ -85,8 +85,7 @@ function setupMobilePanelSelector() {
if (panel instanceof Panel) { if (panel instanceof Panel) {
overlay.append(panel.node); overlay.append(panel.node);
overlay.show(); overlay.show();
$(panel.node).show(); panel.update();
if (panel.onResize) panel.onResize();
} else { } else {
overlay.hide(); overlay.hide();
} }

14
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "Blockbench", "name": "Blockbench",
"version": "4.0.0-beta.5", "version": "4.0.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -2602,9 +2602,9 @@
} }
}, },
"core-js": { "core-js": {
"version": "3.18.2", "version": "3.18.3",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.2.tgz", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.3.tgz",
"integrity": "sha512-zNhPOUoSgoizoSQFdX1MeZO16ORRb9FFQLts8gSYbZU5FcgXhp24iMWMxnOQo5uIaIG7/6FA/IqJPwev1o9ZXQ==", "integrity": "sha512-tReEhtMReZaPFVw7dajMx0vlsz3oOb8ajgPoHVYGxr8ErnZ6PcYEvvmjGmXlfpnxpkYSdOQttjB+MvVbCGfvLw==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
@ -2864,9 +2864,9 @@
}, },
"dependencies": { "dependencies": {
"@types/node": { "@types/node": {
"version": "14.17.21", "version": "14.17.27",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.21.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.27.tgz",
"integrity": "sha512-zv8ukKci1mrILYiQOwGSV4FpkZhyxQtuFWGya2GujWg+zVAeRQ4qbaMmWp9vb9889CFA8JECH7lkwCL6Ygg8kA==", "integrity": "sha512-94+Ahf9IcaDuJTle/2b+wzvjmutxXAEXU6O81JHblYXUg2BDG+dnBy7VxIPHKAyEEDHzCMQydTJuWvrE+Aanzw==",
"dev": true "dev": true
} }
} }

View File

@ -1,7 +1,7 @@
{ {
"name": "Blockbench", "name": "Blockbench",
"description": "Low-poly modeling and animation software", "description": "Low-poly modeling and animation software",
"version": "4.0.0", "version": "4.0.1",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"author": { "author": {
"name": "JannisX11", "name": "JannisX11",