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
script:
- sudo apt-get install rpm
- npm install electron@13.5.2
- electron-builder --publish=onTagOrDraft
cache:

View File

@ -192,7 +192,9 @@ class Panel {
let show = BARS.condition(this.condition)
if (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
} else if (Interface.data.right_bar.includes(this.id)) {
this.width = Interface.data.right_bar_width

View File

@ -24,7 +24,7 @@ class ModelFormat {
ModelFormat.properties[id].merge(this, data);
}
}
select(converting) {
select() {
if (Format && typeof Format.onDeactivation == 'function') {
Format.onDeactivation()
}
@ -32,9 +32,6 @@ class ModelFormat {
if (typeof this.onActivation == 'function') {
Format.onActivation()
}
if (!converting || !this.optional_box_uv) {
Project.box_uv = Format.box_uv;
}
buildGrid()
if (Format.centered_grid) {
scene.position.set(0, 0, 0);
@ -47,12 +44,6 @@ class ModelFormat {
}
})
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;
Modes.vue.$forceUpdate()
updateInterfacePanels()
@ -73,9 +64,12 @@ class ModelFormat {
Project.export_path = '';
var old_format = Format
this.select(true)
this.select();
Modes.options.edit.select()
// Box UV
if (!this.optional_box_uv) Project.box_uv = this.box_uv;
//Bone Rig
if (!Format.bone_rig && old_format.bone_rig) {
Group.all.forEach(group => {

View File

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

View File

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

14
package-lock.json generated
View File

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

View File

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