mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Alt+Click to open lorebook
This commit is contained in:
@@ -23,7 +23,7 @@ import { FILTER_TYPES, FilterHelper } from './filters.js';
|
||||
import { selected_group } from './group-chats.js';
|
||||
import { POPUP_RESULT, POPUP_TYPE, Popup, callGenericPopup } from './popup.js';
|
||||
import { t } from './i18n.js';
|
||||
import { world_names } from './world-info.js';
|
||||
import { openWorldInfoEditor, world_names } from './world-info.js';
|
||||
import { renderTemplateAsync } from './templates.js';
|
||||
|
||||
let savePersonasPage = 0;
|
||||
@@ -783,7 +783,11 @@ function onPersonaDescriptionDepthRoleInput() {
|
||||
saveSettingsDebounced();
|
||||
}
|
||||
|
||||
async function onPersonaLoreButtonClick() {
|
||||
/**
|
||||
* Opens a popup to set the lorebook for the current persona.
|
||||
* @param {PointerEvent} event Click event
|
||||
*/
|
||||
async function onPersonaLoreButtonClick(event) {
|
||||
const personaName = power_user.personas[user_avatar];
|
||||
const selectedLorebook = power_user.persona_description_lorebook;
|
||||
|
||||
@@ -792,6 +796,11 @@ async function onPersonaLoreButtonClick() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.altKey && selectedLorebook) {
|
||||
openWorldInfoEditor(selectedLorebook);
|
||||
return;
|
||||
}
|
||||
|
||||
const template = $(await renderTemplateAsync('personaLorebook'));
|
||||
|
||||
const worldSelect = template.find('select');
|
||||
|
Reference in New Issue
Block a user