URL parameters to load model through link

Closes #2179
This commit is contained in:
JannisX11 2024-04-05 21:05:55 +02:00
parent c80a8b2345
commit d2eb6de2d5

View File

@ -122,6 +122,29 @@ async function loadInfoFromURL() {
icon: 'running_with_errors'
})
})
} else if (Blockbench.queries.loadtype) {
let file = {
content: Blockbench.queries.loaddata,
name: Blockbench.queries.loadname || 'file',
path: Blockbench.queries.loadname || 'file'
};
switch (Blockbench.queries.loadtype) {
case 'minecraft_skin': {
Formats.skin.setup_dialog.show();
Formats.skin.setup_dialog.setFormValues({
texture: file
})
break;
}
case 'image': {
loadImages([file]);
break;
}
case 'json': {
loadModelFile(file);
break;
}
}
}
}