Replace speaker-based expression sync with thoughts-driven sync
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user