From f294d43616aa426c651f524e910be920667826a3 Mon Sep 17 00:00:00 2001 From: Clement Balea Date: Wed, 8 May 2024 18:47:39 +0300 Subject: [PATCH] Fix animations (#50) * fix animation * up README.md * rm logs * cleanup * up version * fix README.md --- README.md | 13 +++++++++++++ package.json | 2 +- tests/mocks.js | 10 +++++----- types/character_modeling.d.ts | 12 ------------ wow_model_viewer.js | 3 ++- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index bfeb70a..6d42fe6 100644 --- a/README.md +++ b/README.md @@ -381,6 +381,19 @@ Path | 256 | Itemvisual | 512 | Collection | 102 | +# Updates +As this library is based on a minified version of the Wowhead model viewer, regular upgrades of this library may require you to clear your cached data. +If you are using a Docker `bypass-cors-policies` container, you can follow these steps to clean up the cache: + +```sh +docker exec -it [container_id_or_name] /bin/sh + +# Inside your container +cd storage/ +rm -rf * +``` +If you are not using this Docker container, please adapt the cleanup process according to your environment. + # Contribute Each contribution to this lib have to take in account js doc and typescript diff --git a/package.json b/package.json index 5819e17..ce6a9a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wow-model-viewer", - "version": "1.3.4", + "version": "1.3.5", "description": "Generate World of Warcraft 3D model with body parts customization and items.", "engines": { "node": ">=16.0.0 <19.0.0" diff --git a/tests/mocks.js b/tests/mocks.js index 2fba076..a6394c2 100644 --- a/tests/mocks.js +++ b/tests/mocks.js @@ -2,15 +2,15 @@ class ZamModelViewer { constructor() { this.renderer = { models: [{ - ap: [{ - j: `animation1` + am: [{ + l: `animation1` }, { - j: `animation2` + l: `animation2` }, { - j: `animation3` + l: `animation3` }], setAnimation: function (val) { - if (!this.ap.find(e => e.j === val)) { + if (!this.am.find(e => e.l === val)) { // nothing } }, diff --git a/types/character_modeling.d.ts b/types/character_modeling.d.ts index c2a61c8..7114fc3 100644 --- a/types/character_modeling.d.ts +++ b/types/character_modeling.d.ts @@ -26,18 +26,6 @@ export function optionsFromModel(model: any, fullOptions: {}): { * @returns {Promise} */ export function findRaceGenderOptions(race: number, gender: number): Promise; -export const RACES: { - 1: string; - 2: string; - 3: string; - 4: string; - 5: string; - 6: string; - 7: string; - 8: string; - 10: string; - 11: string; -}; /** * Returns a 2-dimensional list the inner list contains on first position the item slot, the second the item * display-id ex: [[1,1170],[3,4925]] diff --git a/wow_model_viewer.js b/wow_model_viewer.js index 97bea9a..6cf4220 100644 --- a/wow_model_viewer.js +++ b/wow_model_viewer.js @@ -8,7 +8,8 @@ class WowModelViewer extends ZamModelViewer { * @returns {Array.} */ getListAnimations() { - return [...new Set(this.renderer.models[0].ap.map(e => e.j))] + console.log(`getListAnimations`) + return [...new Set(this.renderer.models[0].am.map(e => e.l))] } /**