mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-03 03:17:54 +01:00
Groups: add 'manual' reply strategy
This commit is contained in:
parent
c3b416b4cf
commit
99220d6a88
@ -5055,6 +5055,7 @@
|
|||||||
<span data-i18n="Group reply strategy">Group reply strategy</span>
|
<span data-i18n="Group reply strategy">Group reply strategy</span>
|
||||||
</label>
|
</label>
|
||||||
<select id="rm_group_activation_strategy">
|
<select id="rm_group_activation_strategy">
|
||||||
|
<option value="2" data-i18n="Manual">Manual</option>
|
||||||
<option value="0" data-i18n="Natural order">Natural order</option>
|
<option value="0" data-i18n="Natural order">Natural order</option>
|
||||||
<option value="1" data-i18n="List order">List order</option>
|
<option value="1" data-i18n="List order">List order</option>
|
||||||
</select>
|
</select>
|
||||||
|
@ -110,6 +110,7 @@ let newGroupMembers = [];
|
|||||||
export const group_activation_strategy = {
|
export const group_activation_strategy = {
|
||||||
NATURAL: 0,
|
NATURAL: 0,
|
||||||
LIST: 1,
|
LIST: 1,
|
||||||
|
MANUAL: 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const group_generation_mode = {
|
export const group_generation_mode = {
|
||||||
@ -852,6 +853,9 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) {
|
|||||||
else if (activationStrategy === group_activation_strategy.LIST) {
|
else if (activationStrategy === group_activation_strategy.LIST) {
|
||||||
activatedMembers = activateListOrder(enabledMembers);
|
activatedMembers = activateListOrder(enabledMembers);
|
||||||
}
|
}
|
||||||
|
else if (activationStrategy === group_activation_strategy.MANUAL && !isUserInput) {
|
||||||
|
activatedMembers = shuffle(enabledMembers).slice(0, 1).map(x => characters.findIndex(y => y.avatar === x)).filter(x => x !== -1);
|
||||||
|
}
|
||||||
|
|
||||||
if (activatedMembers.length === 0) {
|
if (activatedMembers.length === 0) {
|
||||||
//toastr.warning('All group members are disabled. Enable at least one to get a reply.');
|
//toastr.warning('All group members are disabled. Enable at least one to get a reply.');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user