mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-27 04:21:46 +08:00
Integrate export codec selector into closing save flow
Fix issue with uninstalling plugins Add preview.texture_frame variable Fix textures getting stuck in non-existant frame after removing animation frames
This commit is contained in:
parent
0e4272bee3
commit
eb09fcb4a5
@ -1197,6 +1197,14 @@ const Animator = {
|
||||
let texture = Texture.all[tex_index % Texture.all.length];
|
||||
if (texture) texture.select();
|
||||
}
|
||||
if (Interface.Panels.variable_placeholders.inside_vue.text.match(/^\s*preview\.texture_frame\s*=/mi)) {
|
||||
let frame = Animator.MolangParser.variableHandler('preview.texture_frame');
|
||||
|
||||
Texture.all.forEach(tex => {
|
||||
tex.currentFrame = (frame % tex.frameCount) || 0;
|
||||
})
|
||||
TextureAnimator.update(Texture.all.filter(tex => tex.frameCount > 1));
|
||||
}
|
||||
if (Project) Project.model_3d.scale.set(1, 1, 1);
|
||||
if (Interface.Panels.variable_placeholders.inside_vue.text.match(/^\s*preview\.scale\s*=/mi)) {
|
||||
let scale = Animator.MolangParser.variableHandler('preview.scale');
|
||||
|
@ -342,7 +342,11 @@ class ModelProject {
|
||||
noLink: true
|
||||
})
|
||||
if (answer === 0) {
|
||||
BarItems.save_project.trigger();
|
||||
if (Project.save_path || Project.export_path) {
|
||||
BarItems.save_project.trigger();
|
||||
} else {
|
||||
await BarItems.export_over.click();
|
||||
}
|
||||
return Project.saved;
|
||||
}
|
||||
return answer !== 2;
|
||||
|
@ -31,7 +31,7 @@ const Plugins = {
|
||||
}
|
||||
}
|
||||
StateMemory.init('installed_plugins', 'array')
|
||||
Plugins.installed = StateMemory.installed_plugins.filter(p => typeof p == 'object');
|
||||
Plugins.installed = StateMemory.installed_plugins = StateMemory.installed_plugins.filter(p => p && typeof p == 'object');
|
||||
|
||||
class Plugin {
|
||||
constructor(id, data) {
|
||||
@ -436,8 +436,6 @@ async function loadInstalledPlugins() {
|
||||
}
|
||||
const install_promises = [];
|
||||
|
||||
Plugins.installed.replace(Plugins.installed.filter(p => p !== null))
|
||||
|
||||
if (Plugins.json instanceof Object && navigator.onLine) {
|
||||
//From Store
|
||||
for (var id in Plugins.json) {
|
||||
|
@ -192,6 +192,7 @@ class Texture {
|
||||
let dimensions_changed = scope.width !== img.naturalWidth || scope.height !== img.naturalHeight;
|
||||
scope.width = img.naturalWidth;
|
||||
scope.height = img.naturalHeight;
|
||||
scope.currentFrame = Math.min(scope.currentFrame, (scope.frameCount||1)-1)
|
||||
|
||||
if (scope.isDefault) {
|
||||
console.log('Successfully loaded '+scope.name+' from default pack')
|
||||
|
Loading…
Reference in New Issue
Block a user