Allow setting specific sprites as expressions

- Update /expression-set command to allow setting specific sprites
- Enhance enum completion for /expression-set to show expressions/sprites and more their info
- Fix setting sprite folder reprinting stuff double
- Fix not being able to unset expressions
This commit is contained in:
Wolfsblvt
2025-01-30 02:42:05 +01:00
parent 73393a5d5e
commit 198d10e759
3 changed files with 210 additions and 68 deletions

View File

@ -1833,14 +1833,15 @@ async function loadContextSettings() {
/**
* Common function to perform fuzzy search with optional caching
* @template T
* @param {string} type - Type of search from fuzzySearchCategories
* @param {any[]} data - Data array to search in
* @param {Array<{name: string, weight: number, getFn?: (obj: any) => string}>} keys - Fuse.js keys configuration
* @param {T[]} data - Data array to search in
* @param {Array<{name: string, weight: number, getFn?: (obj: T) => string}>} keys - Fuse.js keys configuration
* @param {string} searchValue - The search term
* @param {Object.<string, { resultMap: Map<string, any> }>} [fuzzySearchCaches=null] - Optional fuzzy search caches
* @returns {import('fuse.js').FuseResult<any>[]} Results as items with their score
* @returns {import('fuse.js').FuseResult<T>[]} Results as items with their score
*/
function performFuzzySearch(type, data, keys, searchValue, fuzzySearchCaches = null) {
export function performFuzzySearch(type, data, keys, searchValue, fuzzySearchCaches = null) {
// Check cache if provided
if (fuzzySearchCaches) {
const cache = fuzzySearchCaches[type];