From 8c431ab337fa684de52d4e0a8565083100574a49 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 11 Aug 2021 23:19:26 -0400 Subject: [PATCH] Update figuredata checker --- src/nitro/avatar/AvatarRenderManager.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/nitro/avatar/AvatarRenderManager.ts b/src/nitro/avatar/AvatarRenderManager.ts index ebb2ef24..5675bec1 100644 --- a/src/nitro/avatar/AvatarRenderManager.ts +++ b/src/nitro/avatar/AvatarRenderManager.ts @@ -1,3 +1,4 @@ +import { NitroLogger } from '../../core'; import { IAssetManager } from '../../core/asset/IAssetManager'; import { NitroManager } from '../../core/common/NitroManager'; import { NitroEvent } from '../../core/events/NitroEvent'; @@ -194,15 +195,17 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa private loadFigureData(): void { - const defaultFigureData = (Nitro.instance.getConfiguration('avatar.default.figuredata') as IFigureData); + const defaultFigureData = Nitro.instance.getConfiguration('avatar.default.figuredata'); - if(defaultFigureData) + if(!defaultFigureData || (typeof defaultFigureData === 'string')) { - if(!defaultFigureData) throw new Error('invalid_default_figure_data'); + NitroLogger.log('XML figuredata is no longer supported.'); - if(this._structure) this._structure.initFigureData(defaultFigureData); + return; } + if(this._structure) this._structure.initFigureData(defaultFigureData); + const structureDownloader = new AvatarStructureDownload(Nitro.instance.getConfiguration('avatar.figuredata.url'), (this._structure.figureData as IFigureSetData)); structureDownloader.addEventListener(AvatarStructureDownload.AVATAR_STRUCTURE_DONE, this.onAvatarStructureDownloadDone);