diff --git a/public/img/No-Image-Placeholder.svg b/public/img/No-Image-Placeholder.svg new file mode 100644 index 000000000..d21137506 --- /dev/null +++ b/public/img/No-Image-Placeholder.svg @@ -0,0 +1,309 @@ + + diff --git a/public/scripts/extensions.js b/public/scripts/extensions.js index a017bb5d7..6b7e73340 100644 --- a/public/scripts/extensions.js +++ b/public/scripts/extensions.js @@ -4,6 +4,7 @@ export { getContext, getApiUrl, defaultRequestArgs, + modules, }; const extensionNames = ['caption', 'dice', 'expressions', 'floating-prompt', 'memory']; diff --git a/public/scripts/extensions/expressions/index.js b/public/scripts/extensions/expressions/index.js index 8e8cb4262..286bdafd3 100644 --- a/public/scripts/extensions/expressions/index.js +++ b/public/scripts/extensions/expressions/index.js @@ -1,5 +1,4 @@ -import { getContext, getApiUrl } from "../../extensions.js"; -import { urlContentToDataUri } from "../../utils.js"; +import { getContext, getApiUrl, modules } from "../../extensions.js"; export { MODULE_NAME }; const MODULE_NAME = 'expressions'; @@ -67,6 +66,15 @@ async function moduleWorker() { validateImages(); } + if (!modules.includes('classify')) { + $('.expression_settings .offline_mode').css('display', 'block'); + lastCharacter = context.characterId; + return; + } + else { + $('.expression_settings .offline_mode').css('display', 'none'); + } + // check if last message changed const currentLastMessage = getLastCharacterMessage(); if (lastCharacter === context.characterId && lastMessage === currentLastMessage) { @@ -139,16 +147,25 @@ async function validateImages() { image.width = '0px'; image.height = '0px'; image.onload = function () { - $('#image_list').append(`
You are in offline mode. Click on the image below to set the expression.
+Hint: Create new folder in the public/characters/ folder and name it as the name of the character. Put PNG images with expressions there.