mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-21 01:13:37 +08:00
Enable "Open in Blockbench" in web app
This commit is contained in:
parent
d4ac02f4d6
commit
0a594799cc
@ -93,7 +93,8 @@ const Interface = {
|
||||
slot: 'right_bar',
|
||||
float_position: [300, 0],
|
||||
float_size: [300, 300],
|
||||
height: 300
|
||||
height: 300,
|
||||
folded: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1805,11 +1805,18 @@ class Texture {
|
||||
{
|
||||
icon: 'draw',
|
||||
name: 'menu.texture.edit_in_blockbench',
|
||||
condition: (texture) => !Format.image_editor && texture.path,
|
||||
condition: (texture) => !Format.image_editor,
|
||||
click(texture) {
|
||||
let existing_tab = ModelProject.all.find(project => project.format.image_editor && project.textures.find(t => t.path && t.path == texture.path));
|
||||
let existing_tab, tex2;
|
||||
for (let project of ModelProject.all) {
|
||||
if (!project.format.image_editor) continue;
|
||||
tex2 = project.textures.find(t => t.uuid == texture.uuid || (t.path && t.path == texture.path));
|
||||
if (tex2) {
|
||||
existing_tab = project;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (existing_tab) {
|
||||
let tex2 = existing_tab.textures.find(t => t.path && t.path == texture.path);
|
||||
existing_tab.select();
|
||||
tex2.select();
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user