mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-02 20:36:49 +01:00
Don't try to load live2d if variable is disabled or module is not loaded to Extras
This commit is contained in:
parent
c5d87e4808
commit
7f86551ab4
@ -397,6 +397,16 @@ function onExpressionsShowDefaultInput() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadLiveChar(value_name) {
|
function loadLiveChar(value_name) {
|
||||||
|
if (!live2d_var) {
|
||||||
|
console.debug('live2d is disabled');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!modules.includes('live2d')) {
|
||||||
|
console.debug('live2d module is disabled');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let url = `${getApiUrl()}/api/live2d/load?loadchar=${location.origin}/characters/${value_name}`;
|
let url = `${getApiUrl()}/api/live2d/load?loadchar=${location.origin}/characters/${value_name}`;
|
||||||
doExtrasFetch(url, {
|
doExtrasFetch(url, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@ -473,7 +483,9 @@ async function moduleWorker() {
|
|||||||
imgElement.src = "";
|
imgElement.src = "";
|
||||||
|
|
||||||
//Load new char
|
//Load new char
|
||||||
loadLiveChar(context.name2 + ".png");
|
if (live2d_var) {
|
||||||
|
loadLiveChar(context.name2 + ".png");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const vnMode = isVisualNovelMode();
|
const vnMode = isVisualNovelMode();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user