Replace speaker-based expression sync with thoughts-driven sync

This commit is contained in:
Tremendoussly
2026-03-15 21:38:45 +01:00
parent 9ef5b16663
commit c79c941871
11 changed files with 1003 additions and 419 deletions
+6
View File
@@ -22,6 +22,7 @@ import {
} from '../../utils/presentCharacters.js';
import { isItemLocked, setItemLock } from '../generation/lockManager.js';
import { renderAlternatePresentCharacters } from '../ui/alternatePresentCharacters.js';
import { queueExpressionSyncFromThoughts } from '../integration/expressionSync.js';
/**
* Helper to generate lock icon HTML if setting is enabled
@@ -92,6 +93,7 @@ function getStatColor(percentage, lowColor, highColor, lowOpacity = 100, highOpa
*/
export function renderThoughts({ preserveScroll = false, useCommittedFallback = true } = {}) {
renderAlternatePresentCharacters({ useCommittedFallback });
queueExpressionSyncFromThoughts();
if (!extensionSettings.showCharacterThoughts || !$thoughtsContainer) {
return;
@@ -1281,6 +1283,10 @@ export function updateCharacterField(characterName, field, value) {
// console.log('[RPG Companion] Is editing thoughts?', isEditingThoughts, 'Field:', field, 'Thoughts field name:', thoughtsFieldName);
// console.log('[RPG Companion] After update - lastGeneratedData.characterThoughts:', lastGeneratedData.characterThoughts);
if (field === 'name' || isEditingThoughts) {
queueExpressionSyncFromThoughts({ immediate: true, force: true });
}
if (isEditingThoughts && extensionSettings.showThoughtsInChat) {
// console.log('[RPG Companion] Updating chat thought bubbles');
// Update chat thought bubbles when thoughts are edited