diff --git a/src/model.js b/src/model.js index 23b036a..216eae1 100644 --- a/src/model.js +++ b/src/model.js @@ -29,7 +29,11 @@ class Model { showMessage(message, 4000, 10); if (this.useCDN) { if (!this.modelList) await this.loadModelList(); - const target = randomSelection(this.modelList.models[modelId]); + let target = modelTexturesId; + if (typeof modelTexturesId === 'number') { + target = randomSelection(this.modelList.models[modelId]); + localStorage.setItem("modelTexturesId", target); + } loadlive2d("live2d", `${this.cdnPath}model/${target}/index.json`); } else { loadlive2d("live2d", `${this.apiPath}get/?id=${modelId}-${modelTexturesId}`); @@ -43,6 +47,7 @@ class Model { if (this.useCDN) { if (!this.modelList) await this.loadModelList(); const target = randomSelection(this.modelList.models[modelId]); + localStorage.setItem("modelTexturesId", modelTexturesId); loadlive2d("live2d", `${this.cdnPath}model/${target}/index.json`); showMessage("我的新衣服好看嘛?", 4000, 10); } else {