#1758 Mute character in group chat but keep character card

This commit is contained in:
Cohee 2024-01-30 12:27:31 +02:00
parent da7b435b7c
commit 079ab7db07
2 changed files with 6 additions and 4 deletions

View File

@ -3937,7 +3937,8 @@
</div>
<select id="rm_group_generation_mode">
<option value="0" data-i18n="Swap character cards">Swap character cards</option>
<option value="1" data-i18n="Join character cards">Join character cards</option>
<option value="1" data-i18n="Join character cards (exclude muted)">Join character cards (exclude muted)</option>
<option value="2" data-i18n="Join character cards (include muted)">Join character cards (include muted)</option>
</select>
</div>
</div>

View File

@ -108,6 +108,7 @@ export const group_activation_strategy = {
export const group_generation_mode = {
SWAP: 0,
APPEND: 1,
APPEND_DISABLED: 2,
};
const DEFAULT_AUTO_MODE_DELAY = 5;
@ -325,7 +326,7 @@ export function getGroupDepthPrompts(groupId, characterId) {
}
/**
* Combines group members info a single string. Only for groups with generation mode set to APPEND.
* Combines group members cards into a single string. Only for groups with generation mode set to APPEND or APPEND_DISABLED.
* @param {string} groupId Group ID
* @param {number} characterId Current Character ID
* @returns {{description: string, personality: string, scenario: string, mesExamples: string}} Group character cards combined
@ -334,7 +335,7 @@ export function getGroupCharacterCards(groupId, characterId) {
console.debug('getGroupCharacterCards entered for group: ', groupId);
const group = groups.find(x => x.id === groupId);
if (!group || group?.generation_mode !== group_generation_mode.APPEND || !Array.isArray(group.members) || !group.members.length) {
if (!group || !group?.generation_mode || !Array.isArray(group.members) || !group.members.length) {
return null;
}
@ -354,7 +355,7 @@ export function getGroupCharacterCards(groupId, characterId) {
continue;
}
if (group.disabled_members.includes(member) && characterId !== index) {
if (group.disabled_members.includes(member) && characterId !== index && group.generation_mode !== group_generation_mode.APPEND_DISABLED) {
console.debug(`Skipping disabled group member: ${member}`);
continue;
}