full suport for models and hotloading Plugins
This commit is contained in:
@@ -177,6 +177,7 @@
|
||||
const member = btn.dataset.member;
|
||||
const name = btn.dataset.name || member;
|
||||
const modelFormat = btn.dataset.modelFormat || '.geo.json';
|
||||
const slug = btn.dataset.projectSlug || '';
|
||||
const opts = { baseUrl: btn.dataset.baseUrl, vanillaBaseUrl: btn.dataset.vanillaBaseUrl, defaultTexture: btn.dataset.defaultTexture || null };
|
||||
if (!member || !opts.baseUrl || busy) return;
|
||||
busy = true;
|
||||
@@ -223,6 +224,16 @@
|
||||
busy = false;
|
||||
return;
|
||||
}
|
||||
// Pack plugins to hotload (autoload.txt), unless the user opted out.
|
||||
const noHotload = slug && localStorage.getItem('packs:no-hotload:' + slug) === '1';
|
||||
if (!noHotload && btn.dataset.plugins) {
|
||||
try {
|
||||
const members = JSON.parse(btn.dataset.plugins);
|
||||
msg.plugins = members.map(m => ({ member: m, url: assetUrl(opts.baseUrl, m) }));
|
||||
} catch (e) {
|
||||
msg.plugins = [];
|
||||
}
|
||||
}
|
||||
if (EMBEDDED_FORMATS.indexOf(modelFormat) !== -1) {
|
||||
// Textures baked into the file — hand it to Blockbench as-is.
|
||||
msg.modelFile = { format: modelFormat, content: await fetchModelText(member, opts.baseUrl) };
|
||||
|
||||
Reference in New Issue
Block a user