mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	add /th (alias /talkinghead) to toggle Talkinghead on/off
				
					
				
			This commit is contained in:
		@@ -58,6 +58,17 @@ function isTalkingHeadEnabled() {
 | 
			
		||||
    return extension_settings.expressions.talkinghead && !extension_settings.expressions.local;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Toggles Talkinghead mode on/off.
 | 
			
		||||
 *
 | 
			
		||||
 * Implements the `/th` slash command, which is meant to be bound to a Quick Reply button
 | 
			
		||||
 * as a quick way to switch Talkinghead on or off (e.g. to conserve GPU resources when AFK
 | 
			
		||||
 * for a long time).
 | 
			
		||||
 */
 | 
			
		||||
function toggleTalkingHeadCommand(_) {
 | 
			
		||||
    setTalkingHeadState(!extension_settings.expressions.talkinghead);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function isVisualNovelMode() {
 | 
			
		||||
    return Boolean(!isMobile() && power_user.waifuMode && getContext().groupId);
 | 
			
		||||
}
 | 
			
		||||
@@ -1711,4 +1722,5 @@ async function fetchImagesNoCache() {
 | 
			
		||||
    registerSlashCommand('sprite', setSpriteSlashCommand, ['emote'], '<span class="monospace">(spriteId)</span> – force sets the sprite for the current character', true, true);
 | 
			
		||||
    registerSlashCommand('spriteoverride', setSpriteSetCommand, ['costume'], '<span class="monospace">(optional folder)</span> – sets an override sprite folder for the current character. If the name starts with a slash or a backslash, selects a sub-folder in the character-named folder. Empty value to reset to default.', true, true);
 | 
			
		||||
    registerSlashCommand('lastsprite', (_, value) => lastExpression[value.trim()] ?? '', [], '<span class="monospace">(charName)</span> – Returns the last set sprite / expression for the named character.', true, true);
 | 
			
		||||
    registerSlashCommand('th', toggleTalkingHeadCommand, ['talkinghead'], '– Character Expressions: toggles <i>Image Type - talkinghead (extras)</i> on/off.');
 | 
			
		||||
})();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user