diff --git a/resources/assets/src/components/Previewer.vue b/resources/assets/src/components/Previewer.vue index f8754f7c..c7717bd4 100644 --- a/resources/assets/src/components/Previewer.vue +++ b/resources/assets/src/components/Previewer.vue @@ -100,6 +100,10 @@ export default { this.viewer.skinUrl = url || SkinSteve }, cape(url) { + if (!url) { + this.viewer.playerObject.cape.visible = false + return + } this.viewer.capeUrl = url }, }, diff --git a/resources/assets/tests/__mocks__/skinview3d.ts b/resources/assets/tests/__mocks__/skinview3d.ts index 7479bb11..cc864971 100644 --- a/resources/assets/tests/__mocks__/skinview3d.ts +++ b/resources/assets/tests/__mocks__/skinview3d.ts @@ -1,5 +1,8 @@ /* eslint-disable max-params */ /* eslint-disable max-classes-per-file */ +import { + PlayerObject, SkinObject, CapeObject, +} from 'skinview3d' export class SkinViewer { disposed: boolean @@ -12,6 +15,8 @@ export class SkinViewer { camera: { position: { z: number } } + playerObject: PlayerObject + constructor() { this.skinUrl = '' this.capeUrl = '' @@ -22,6 +27,10 @@ export class SkinViewer { z: 0, }, } + this.playerObject = { + skin: {} as SkinObject, + cape: {} as CapeObject, + } } dispose() {