talkinghead mode: don't check for existence of static emote sprite

This commit is contained in:
Juha Jeronen
2024-01-06 02:10:09 +02:00
parent a7c6f4f56e
commit 2d85d7e1e1

View File

@ -736,6 +736,9 @@ async function setSpriteSlashCommand(_, spriteId) {
spriteId = spriteId.trim().toLowerCase(); spriteId = spriteId.trim().toLowerCase();
// In talkinghead mode, don't check for the existence of the sprite
// (emotion names are the same as for sprites, but it only needs "talkinghead.png").
if (extension_settings.expressions.local || !extension_settings.expressions.talkinghead) {
const currentLastMessage = getLastCharacterMessage(); const currentLastMessage = getLastCharacterMessage();
const spriteFolderName = getSpriteFolderName(currentLastMessage, currentLastMessage.name); const spriteFolderName = getSpriteFolderName(currentLastMessage, currentLastMessage.name);
await validateImages(spriteFolderName); await validateImages(spriteFolderName);
@ -749,6 +752,7 @@ async function setSpriteSlashCommand(_, spriteId) {
console.log('No sprite found for search term ' + spriteId); console.log('No sprite found for search term ' + spriteId);
return; return;
} }
}
const vnMode = isVisualNovelMode(); const vnMode = isVisualNovelMode();
await sendExpressionCall(spriteFolderName, spriteItem.label, true, vnMode); await sendExpressionCall(spriteFolderName, spriteItem.label, true, vnMode);