Fixed null not removing capes

Removed pointless logging
This commit is contained in:
James Harrison 2020-09-10 22:17:54 +01:00
parent 2c43046af5
commit 150dbbd61c
1 changed files with 4 additions and 4 deletions

View File

@ -211,15 +211,14 @@ class SkinViewer {
/** /**
* Code for MinecraftCapes * Code for MinecraftCapes
*/ */
protected loadCustomCape(source: TextureSource | RemoteImage | null): void | Promise<void> { public loadCustomCape(source: TextureSource | RemoteImage | null): void | Promise<void> {
if(source === null) { if(source === null) {
this.resetCape(); this.resetCape();
} else if(isTextureSource(source)) { } else if(isTextureSource(source)) {
this.customCapeImage = source; this.customCapeImage = source;
this.loadCapeToCanvas(this.capeCanvas, source, 0); this.loadCapeToCanvas(this.capeCanvas, source, 0);
this.capeLoaded();
} else { } else {
return loadImage(source).then(image => this.loadCustomCape(image)); loadImage(source).then(image => this.loadCustomCape(image)).catch(error => {});
} }
} }
@ -230,6 +229,7 @@ class SkinViewer {
if(frame != null) { if(frame != null) {
frame.clearRect(0, 0, canvas.width, canvas.height), frame.clearRect(0, 0, canvas.width, canvas.height),
frame.drawImage(image, 0, offset, canvas.width, canvas.height, 0, 0, canvas.width, canvas.height) frame.drawImage(image, 0, offset, canvas.width, canvas.height, 0, 0, canvas.width, canvas.height)
this.capeLoaded();
} }
} }
@ -256,7 +256,7 @@ class SkinViewer {
this.loadEarsToCanvas(this.earCanvas, source); this.loadEarsToCanvas(this.earCanvas, source);
this.earsLoaded(); this.earsLoaded();
} else { } else {
return loadImage(source).then(image => this.loadEars(image)); loadImage(source).then(image => this.loadEars(image)).catch(error => {});
} }
} }