Add WIEntry support for new match options

750e8c89a7f9e283d7c79a1be4a6c01a59c1f9f7

Crow <bismuthglass@protonmail.com>

1 files changed, +28 -0Ignore whitespace
public/scripts/world-info.js+28 -0
@@ -2191,6 +2191,12 @@ export const originalWIDataKeyMap = {
2191 'matchWholeWords': 'extensions.match_whole_words',2191 'matchWholeWords': 'extensions.match_whole_words',
2192 'useGroupScoring': 'extensions.use_group_scoring',2192 'useGroupScoring': 'extensions.use_group_scoring',
2193 'caseSensitive': 'extensions.case_sensitive',2193 'caseSensitive': 'extensions.case_sensitive',
2194 'matchPersonaDescription': 'extensions.match_persona_description',
2195 'matchCharacterDescription': 'extensions.match_character_description',
2196 'matchCharacterPersonality': 'extensions.match_character_personality',
2197 'matchCharacterNote': 'extensions.match_character_note',
2198 'matchScenario': 'extensions.match_scenario',
2199 'matchCharacterMetadata': 'extensions.match_character_metadata',
2194 'scanDepth': 'extensions.scan_depth',2200 'scanDepth': 'extensions.scan_depth',
2195 'automationId': 'extensions.automation_id',2201 'automationId': 'extensions.automation_id',
2196 'vectorized': 'extensions.vectorized',2202 'vectorized': 'extensions.vectorized',
@@ -3308,6 +3314,28 @@ export async function getWorldEntry(name, data, entry) {
3308 });3314 });
3309 useGroupScoringSelect.val((entry.useGroupScoring === null || entry.useGroupScoring === undefined) ? 'null' : entry.useGroupScoring ? 'true' : 'false').trigger('input');3315 useGroupScoringSelect.val((entry.useGroupScoring === null || entry.useGroupScoring === undefined) ? 'null' : entry.useGroupScoring ? 'true' : 'false').trigger('input');
33103316
3317 function handleOptionalSelect(name) {
3318 const key = originalWIDataKeyMap[name];
3319 const selectElem = template.find(`select[name="${name}"]`);
3320 selectElem.data('uid', entry.uid);
3321 selectElem.on('input', async function () {
3322 const uid = $(this).data('uid');
3323 const value = $(this).val();
3324
3325 data.entries[uid][name] = value === 'null' ? null : value === 'true';
3326 setWIOriginalDataValue(data, uid, key, data.entries[uid][name]);
3327 await saveWorldInfo(name, data);
3328 });
3329 selectElem.val((entry[name] === null || entry[name] === undefined) ? 'null' : entry[name] ? 'true' : 'false').trigger('input');
3330 }
3331
3332 handleOptionalSelect("matchPersonaDescription");
3333 handleOptionalSelect("matchCharacterDescription");
3334 handleOptionalSelect("matchCharacterPersonality");
3335 handleOptionalSelect("matchCharacterNote");
3336 handleOptionalSelect("matchScenario");
3337 handleOptionalSelect("matchCharacterMetadata");
3338
3311 // automation id3339 // automation id
3312 const automationIdInput = template.find('input[name="automationId"]');3340 const automationIdInput = template.find('input[name="automationId"]');
3313 automationIdInput.data('uid', entry.uid);3341 automationIdInput.data('uid', entry.uid);