mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
custom_stopping_strings_macro toggleable option
This commit is contained in:
@ -147,6 +147,7 @@
|
|||||||
"persona_description": "",
|
"persona_description": "",
|
||||||
"persona_description_position": 0,
|
"persona_description_position": 0,
|
||||||
"custom_stopping_strings": "",
|
"custom_stopping_strings": "",
|
||||||
|
"custom_stopping_strings_macro": true,
|
||||||
"fuzzy_search": false
|
"fuzzy_search": false
|
||||||
},
|
},
|
||||||
"extension_settings": {
|
"extension_settings": {
|
||||||
|
@ -2038,6 +2038,12 @@
|
|||||||
<div>
|
<div>
|
||||||
<textarea id="custom_stopping_strings" rows="2" class="text_pole textarea_compact" placeholder="["Ford", "BMW", "Fiat"]"></textarea>
|
<textarea id="custom_stopping_strings" rows="2" class="text_pole textarea_compact" placeholder="["Ford", "BMW", "Fiat"]"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
<label class="checkbox_label" for="custom_stopping_strings_macro">
|
||||||
|
<input id="custom_stopping_strings_macro" type="checkbox" checked>
|
||||||
|
<span data-i18n="Replace Macro in Custom Stopping Strings">
|
||||||
|
Replace Macro in Custom Stopping Strings
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
<h4>
|
<h4>
|
||||||
<span data-i18n="Pygmalion Formatting">
|
<span data-i18n="Pygmalion Formatting">
|
||||||
Pygmalion Formatting
|
Pygmalion Formatting
|
||||||
|
@ -1750,7 +1750,11 @@ function getStoppingStrings(isImpersonate, addSpace) {
|
|||||||
|
|
||||||
if (power_user.custom_stopping_strings) {
|
if (power_user.custom_stopping_strings) {
|
||||||
const customStoppingStrings = getCustomStoppingStrings();
|
const customStoppingStrings = getCustomStoppingStrings();
|
||||||
|
if (power_user.custom_stopping_strings_macro) {
|
||||||
result.push(...customStoppingStrings.map(x => substituteParams(x, name1, name2)));
|
result.push(...customStoppingStrings.map(x => substituteParams(x, name1, name2)));
|
||||||
|
} else {
|
||||||
|
result.push(...customStoppingStrings);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return addSpace ? result.map(x => `${x} `) : result;
|
return addSpace ? result.map(x => `${x} `) : result;
|
||||||
|
@ -188,6 +188,7 @@ let power_user = {
|
|||||||
persona_show_notifications: true,
|
persona_show_notifications: true,
|
||||||
|
|
||||||
custom_stopping_strings: '',
|
custom_stopping_strings: '',
|
||||||
|
custom_stopping_strings_macro: true,
|
||||||
fuzzy_search: false,
|
fuzzy_search: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -679,6 +680,7 @@ function loadPowerUserSettings(settings, data) {
|
|||||||
$('#auto_swipe_blacklist').val(power_user.auto_swipe_blacklist.join(", "));
|
$('#auto_swipe_blacklist').val(power_user.auto_swipe_blacklist.join(", "));
|
||||||
$('#auto_swipe_blacklist_threshold').val(power_user.auto_swipe_blacklist_threshold);
|
$('#auto_swipe_blacklist_threshold').val(power_user.auto_swipe_blacklist_threshold);
|
||||||
$('#custom_stopping_strings').val(power_user.custom_stopping_strings);
|
$('#custom_stopping_strings').val(power_user.custom_stopping_strings);
|
||||||
|
$("#custom_stopping_strings_macro").prop("checked", power_user.custom_stopping_strings_macro);
|
||||||
$('#fuzzy_search_checkbox').prop("checked", power_user.fuzzy_search);
|
$('#fuzzy_search_checkbox').prop("checked", power_user.fuzzy_search);
|
||||||
$('#persona_show_notifications').prop("checked", power_user.persona_show_notifications);
|
$('#persona_show_notifications').prop("checked", power_user.persona_show_notifications);
|
||||||
|
|
||||||
@ -1996,6 +1998,11 @@ $(document).ready(() => {
|
|||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#custom_stopping_strings_macro").change(function () {
|
||||||
|
power_user.custom_stopping_strings_macro = $(this).prop("checked");
|
||||||
|
saveSettingsDebounced();
|
||||||
|
});
|
||||||
|
|
||||||
$('#fuzzy_search_checkbox').on('input', function () {
|
$('#fuzzy_search_checkbox').on('input', function () {
|
||||||
power_user.fuzzy_search = !!$(this).prop('checked');
|
power_user.fuzzy_search = !!$(this).prop('checked');
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
|
Reference in New Issue
Block a user