Don't die on duplicate images, don't error on noUI and selecting editor

master
William Toohey 9 years ago
parent e109eaaa3e
commit 89549d4762
  1. 3
      src/js/HuesEditor.js
  2. 5
      src/js/ResourcePack.js

@ -126,6 +126,9 @@ HuesEditor.prototype.initUI = function() {
};
HuesEditor.prototype.resize = function(noHilightCalc) {
// If we were never instantiated but called externally
if(!this.root)
return;
this.root.style.height = (window.innerHeight - 200) + "px";
let boxHeight = this.editArea.offsetHeight;
let bHeadHeight = this.buildEdit._header.offsetHeight;

@ -299,7 +299,7 @@ Respack.prototype.parseImage = function(file) {
this.images.push(img);
} else {
let existing = this.getImage(name);
debug("WARNING: Image", name, "already exists! Conflict with", file.name, "and", existing.name);
console.log("WARNING: Image", name, "already exists! Conflict with", file.name, "and", existing.name);
return;
}
@ -338,6 +338,9 @@ Respack.prototype.parseImageQueue = function() {
// Maintain order
return imagePromise;
}).then(response => {
// Don't crash if the respack had duplicate images
if(!response)
return;
let newImg = new Image();
newImg.src = response.bitmap;
if (response.img.animated) {

Loading…
Cancel
Save